Strange ^ M php characters cannot identify

I open the file (saved as ISO 8859-1) using the terminal (Ubuntu) and see where the new lines should be the next character ^M(surrounded by XX before and after).

Now I ran this code in php to see how PHP handles this:

$text=str_split($text);
var_dump($text);

in var_dump, I see only an array of size 4 and only "X" in it.
Any idea what is going on there?

EDIT: open office brings this ^Mto a new line.

OTHER CHANGE: The following code does not change anything. echo str_replace("\r","XXXXXX",$text); I run it beforestr_split

+3
source share
1 answer

^M . ^J - . ^M - , Windows , , . " ". \r.

+5

All Articles