Replacing text function in php -
I want to clear some reciprocal text such as
\ n said \ r \ n \ R \ n \ r \ nI see my beloved in my eyes \ r \ n \ r \ nI look at the green rolling forest \ r \ n \ r \ nI see the far sky \ r \ n \ R \ nThe rain \ r \ n \ r \ n \ r \ nI am seeing the high flying eagle ... more \ n
so I "\ n", "\ r \ n" I'm getting rid of, "\ r \ n \ r \ n", \ r \ n \ r \ n \ r \ n ", \ r \ n \ r \ n \ r \ n \ r \ n" and " \ R "This is all the combination that I've parse Appear in the text.
Is there a way to do this in php?
what about it
$ text = str_replace (array ( "\ N", "\ r"), '', $ text);
This will remove all new line characters.
If you want them as a new line, then I & lt; Br / & gt;
For HTML (or better still, use PHP's nl2br ()
, or standardize it in the normal text with \ n
, for example
Comments
Post a Comment