How to remove empty transitions lines in the html code of the page

0 like 0 dislike
9 views
Help solve the problem. Process text in php using strip_tags(), and then cut /n /t /r using str_replace() but the text turns out like this

The practice of using offshore companies in the world.
In the program:

Offshore, low-tax and prestigious European jüri

How to get rid of these transitions to the text look at the page code into one line?

The practice of using offshore companies in the world. In the program: Offshore, low-tax and prestigious European jüri
by | 9 views

5 Answers

0 like 0 dislike
$text = str_replace(array("\", "\\r"), ", $text);
\r
works for me
by
0 like 0 dislike
$text = str_replace("\",",$text);
\r
write double quotes
by
0 like 0 dislike
No words...
\r
In General, the future of first task set, and then decide. Judging from the explanation you need to remove "\" and "\\r" and replace any sequence of 1 space (most likely a possible exception, but they are known only to you). So if this can get any blank characters, you can write:
\r
$text=preg_replace('/\\s+/',' ',$text);# replace all sequences of blanks to 1 blank
\r
Or the same with the enum in the array using str_replace (I would have stopped in the regular season).
\r
This code will replace any sequence of characters included in "\\s", for 1 space.
\r
And spravochku php read, because there is about a difference in " and ' written, and about the function used in the example, a lot of things so interesting.
by
0 like 0 dislike
in short looks like this
\r
$text = strip_tags($row['text'],");
$text = str_replace('\',",$text);
...
by
0 like 0 dislike
In single quotes are not processed with special characters, '\' it will look for newline, namely two string \.
\r
accordingly, to change
\r
qwe
\r
asd
\r

\r
on
\r
\r
qwe
asd
\r

\r
you need to look for "\\" and replace by "\"
by

Related questions

0 like 0 dislike
3 answers
asked Mar 25, 2019 by xmdy
0 like 0 dislike
1 answer
asked Jun 14, 2019 by Rphoenix
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
28,700 users