Destramic Posted May 10, 2010 Share Posted May 10, 2010 I've looked at the manuel and I need to replace '-' with a space...simple I know if anyone could help me with the right function please Quote Link to comment https://forums.phpfreaks.com/topic/201292-replace-character-in-string/ Share on other sites More sharing options...
kenrbnsn Posted May 10, 2010 Share Posted May 10, 2010 Use the str_replace function: <?php $string = 'This-is-a-test'; echo str_replace('-',' ',$string); ?> Ken Quote Link to comment https://forums.phpfreaks.com/topic/201292-replace-character-in-string/#findComment-1056071 Share on other sites More sharing options...
jskywalker Posted May 10, 2010 Share Posted May 10, 2010 and the manual is at: http://www.php.net/manual/en/function.str-replace.php edit: i overlooked the link in the previous post.... sorry! Quote Link to comment https://forums.phpfreaks.com/topic/201292-replace-character-in-string/#findComment-1056085 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.