How to strip a string from carriage returns and line breaks

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Antek_Ryu
Forum Commoner
Posts: 34
Joined: Tue Aug 09, 2005 10:55 am

How to strip a string from carriage returns and line breaks

Post by Antek_Ryu »

Hi All


I have string of text but for some reason when the text comes through it has hidden carriage returns and line breaks that I dont want how can I stip the text from all these special character;



Antek
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

something like

Code: Select all

$text = str_replace(array("\n","\r"),'',$text);
Post Reply