KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I did a function to remove line break with php with no success, i tryed all replace code and i still get these line break, i create a json file and i can't read it from jsonp with jquery because of these line break seem to break it all. function clean($text) { $text = trim( preg_replace( '/\s+/', ' ', $text ) ); $text = preg_replace("/(\r\n|\n|\r|\t)/i", '', $text); return $text; } When i look at the source, there some line break appening in all href, img and br this is a json_encode output example: <a href=\"http:\/\/example.com\/out\/content\/\" title=\"link to content website\"> line break afer a. it's hapenig to img src and br the only way i can remove these break it with $text = preg_replace("/\s/i", '', $text); But you understant that there's no space left in all the string and it's not what we want.
Tags (comma-separated)
Save Edits
Cancel