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"? Quote 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. Quote 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. Quote 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! Quote 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! Quote 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... Quote 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 ??? Quote 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... Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/93963-replace-with-to/#findComment-481438 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.