laxplayin24 Posted May 19, 2006 Share Posted May 19, 2006 I have some text that I am getting that has carriage returns in it and i was wondering if there is a way in php to remvoe them from the text. Thanks for the help. Quote Link to comment https://forums.phpfreaks.com/topic/10009-carriage-returns/ Share on other sites More sharing options...
wildteen88 Posted May 19, 2006 Share Posted May 19, 2006 If you want to remove line breaks/carrage returns then use this:[code]$var = "This has carriage \r\nreturns in it \r . . . . \n . . . ";$var = str_replace(array("\r", "\n"), "", $var);echo $var;[/code]\r\n - for windows\r - for mac\n - linux/unix Quote Link to comment https://forums.phpfreaks.com/topic/10009-carriage-returns/#findComment-37186 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.