robert_gsfame Posted August 9, 2009 Share Posted August 9, 2009 <?php $name = 'FINANCE MANAGER (FM)'; $split = explode(' ', $name); foreach($split as &$part) { $part = ($part{0} != '(') ? ucfirst(strtolower($part)) : $part; } $name = implode(' ', $split); echo $name; I just want to know what ($part{0} refers to ??? and &$part ===> what "&" use for?? thank you. i'm still newbie lOl Link to comment https://forums.phpfreaks.com/topic/169465-simple-questions-related-to-previous-problem/ Share on other sites More sharing options...
wildteen88 Posted August 9, 2009 Share Posted August 9, 2009 $part{0} is referring to the first character in the $part variable. &$part means the variable $part is being passed by reference. As explained in the manual Link to comment https://forums.phpfreaks.com/topic/169465-simple-questions-related-to-previous-problem/#findComment-894118 Share on other sites More sharing options...
robert_gsfame Posted August 9, 2009 Author Share Posted August 9, 2009 thanx for your explanation!! Link to comment https://forums.phpfreaks.com/topic/169465-simple-questions-related-to-previous-problem/#findComment-894122 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.