ccrevcypsys Posted January 22, 2008 Share Posted January 22, 2008 In my database i need to replace the ;'s with <br>'s because of teh way the form is set up. So would i use a preg_replace or what?? Someone help plz Link to comment https://forums.phpfreaks.com/topic/87265-how-would-i-replace-a-with-a/ Share on other sites More sharing options...
revraz Posted January 22, 2008 Share Posted January 22, 2008 You can use mysql to do replace http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace Link to comment https://forums.phpfreaks.com/topic/87265-how-would-i-replace-a-with-a/#findComment-446377 Share on other sites More sharing options...
rhodesa Posted January 22, 2008 Share Posted January 22, 2008 $new_string = str_replace(';','<br />',$string); Link to comment https://forums.phpfreaks.com/topic/87265-how-would-i-replace-a-with-a/#findComment-446381 Share on other sites More sharing options...
revraz Posted January 22, 2008 Share Posted January 22, 2008 Why use PHP when you can use MySQL and never even pull the data out. Link to comment https://forums.phpfreaks.com/topic/87265-how-would-i-replace-a-with-a/#findComment-446382 Share on other sites More sharing options...
tibberous Posted January 22, 2008 Share Posted January 22, 2008 Why use PHP when you can use MySQL and never even pull the data out. Depending on how you do it, PHP would be more typo friendly, You can screw up a lot of data fast with a bad query. Link to comment https://forums.phpfreaks.com/topic/87265-how-would-i-replace-a-with-a/#findComment-446397 Share on other sites More sharing options...
revraz Posted January 22, 2008 Share Posted January 22, 2008 Just as fast as a typo in PHP. Link to comment https://forums.phpfreaks.com/topic/87265-how-would-i-replace-a-with-a/#findComment-446400 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.