Undoubtedly0 Posted July 28, 2009 Share Posted July 28, 2009 How can the following string, mystr, be trimmed so that only the first colon (:) is removed: $mystr = ":hello:world:"; The result of the new string would be "hello:world:". Quote Link to comment https://forums.phpfreaks.com/topic/167869-solved-extremely-simple-php-string-question/ Share on other sites More sharing options...
fooDigi Posted July 28, 2009 Share Posted July 28, 2009 $mystr = ":hello:world:"; echo ltrim($mystr,':'); Quote Link to comment https://forums.phpfreaks.com/topic/167869-solved-extremely-simple-php-string-question/#findComment-885374 Share on other sites More sharing options...
Undoubtedly0 Posted July 28, 2009 Author Share Posted July 28, 2009 Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/167869-solved-extremely-simple-php-string-question/#findComment-885380 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.