I have a variable ($myClass[0]->comment;) that has carriage return in it. I want to replace all the carriage return in that variable with "\n"
how can I do that.
below may help a bit
$myClass[0]->comment;
İşte bazı çıkış
<?php
$test = explode(chr(13),$myClass[0]->comment );
var_dump($test);
?>
ÇIKIŞ
array
0 => string '12' (length=2)
1 => string '
' (length=1)
2 => string '
22' (length=3)
Ben istediğim \n yerine satırbaşı biridir.