prudens Posted March 2, 2008 Share Posted March 2, 2008 Hey, so i have 09-12-2007,05-20-2008,11-20-2010 How do I do a loop to replace all the "," with "to"? Link to comment https://forums.phpfreaks.com/topic/93963-replace-with-to/ Share on other sites More sharing options...
ryeman98 Posted March 2, 2008 Share Posted March 2, 2008 Put that line in a string or if they're already variables just do: $variable = str_replace(",", 'to', $variable); Wow, that's it. Link to comment https://forums.phpfreaks.com/topic/93963-replace-with-to/#findComment-481413 Share on other sites More sharing options...
phpSensei Posted March 2, 2008 Share Posted March 2, 2008 Put that line in a string or if they're already variables just do: $variable = str_replace(",", 'to', $variable); Wow, that's it. That would look ugly, something like 09-12-2007to05-20-2008to11-20-2010 Add Spaces $variable = str_replace(",", ' to ', $variable); 09-12-2007 to 05-20-2008 to 11-20-2010 wow Thats it. Link to comment https://forums.phpfreaks.com/topic/93963-replace-with-to/#findComment-481416 Share on other sites More sharing options...
prudens Posted March 2, 2008 Author Share Posted March 2, 2008 Wow, that was proabbly piece of cake for you guys! Thanks so much! Link to comment https://forums.phpfreaks.com/topic/93963-replace-with-to/#findComment-481426 Share on other sites More sharing options...
ryeman98 Posted March 2, 2008 Share Posted March 2, 2008 lol, thanks for the correction ... it's been a long night Remember to click Topic Solved! Link to comment https://forums.phpfreaks.com/topic/93963-replace-with-to/#findComment-481430 Share on other sites More sharing options...
phpSensei Posted March 2, 2008 Share Posted March 2, 2008 lol, thanks for the correction ... it's been a long night Remember to click Topic Solved! That button ran away somewhere... Link to comment https://forums.phpfreaks.com/topic/93963-replace-with-to/#findComment-481433 Share on other sites More sharing options...
prudens Posted March 2, 2008 Author Share Posted March 2, 2008 how do i click solved?? i dun see it ??? Link to comment https://forums.phpfreaks.com/topic/93963-replace-with-to/#findComment-481434 Share on other sites More sharing options...
phpSensei Posted March 2, 2008 Share Posted March 2, 2008 how do i click solved?? i dun see it ??? The admins updated the site couple of weeks back, alot of bugs occured and one of them was the Topic Solved button malfunctioning. The button is removed until all bugs are fixed on this forum... Link to comment https://forums.phpfreaks.com/topic/93963-replace-with-to/#findComment-481437 Share on other sites More sharing options...
ryeman98 Posted March 2, 2008 Share Posted March 2, 2008 Really? Well that sucks. I didn't notice any bugs. Link to comment https://forums.phpfreaks.com/topic/93963-replace-with-to/#findComment-481438 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.