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 Quote 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 Quote 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); Quote 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. Quote 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. Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.