apulmca Posted February 17, 2009 Share Posted February 17, 2009 Hi all, Actually, I was reading some html and then I use strip_tags() to remove all html tags. Then I found new line and space separated content. But, I want to remove each white space except a single space. What should I do? Any solution? Thanks in advance. PHPOpenSource Link to comment https://forums.phpfreaks.com/topic/145537-solved-remove-whitespace-from-content-using-php/ Share on other sites More sharing options...
Mchl Posted February 17, 2009 Share Posted February 17, 2009 str_replace them? $after = str_replace(array(" "/*that' s two spaces in here*/,"\t","\n","\r","\n\r")," ",$before); Link to comment https://forums.phpfreaks.com/topic/145537-solved-remove-whitespace-from-content-using-php/#findComment-764112 Share on other sites More sharing options...
apulmca Posted February 20, 2009 Author Share Posted February 20, 2009 Thanks. My Problem Solved. Link to comment https://forums.phpfreaks.com/topic/145537-solved-remove-whitespace-from-content-using-php/#findComment-766776 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.