pneudralics Posted May 1, 2009 Share Posted May 1, 2009 $string = "Hi this is my string"; //Want it to look like $string = "Hi-this-is-my-string"; Link to comment https://forums.phpfreaks.com/topic/156366-solved-how-can-i-take-a-string-and-replace-the-space-with-a-dash/ Share on other sites More sharing options...
mikesta707 Posted May 1, 2009 Share Posted May 1, 2009 $string = str_replace(" ", "-" $string); Link to comment https://forums.phpfreaks.com/topic/156366-solved-how-can-i-take-a-string-and-replace-the-space-with-a-dash/#findComment-823264 Share on other sites More sharing options...
pneudralics Posted May 1, 2009 Author Share Posted May 1, 2009 Thanks. Just forgot the , $string = str_replace(" ", "-", $string); Link to comment https://forums.phpfreaks.com/topic/156366-solved-how-can-i-take-a-string-and-replace-the-space-with-a-dash/#findComment-823273 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.