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 Quote 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 Quote 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!! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.