Closed ghost closed 11 years ago
please use PHP_EOL
function convertMultiLineString($string) {
return str_replace(PHP_EOL, "\\".PHP_EOL, $string);
}
now its not work on my. its converted to
var multilineStr = "A
\B";
but in another file is parsed bad with PHP_EOL. maybe?
function convertMultiLineString($string) {
$string = str_replace(PHP_EOL, "\\".PHP_EOL, $string);
return str_replace("\n", "\\\n", $string);
}
I've changed it so that it tries to convert all three of \r\n, \r and \n to PHP_EOL.
That should mean that any line-ending would be converted to the current machines encoding. Can you let me know if that's now working for you?
no. its not work. maybe can you do this way ? 0fd05cd f51376ecf7
Can you post an example of it not working please?
$html='<li id="ser_'.$id.'">
<span><i class="icon-time"></i>'.$d.''.$cas.'</span>
.....
is converted to this
var html='<li id="ser_' + "" + id + "" + '">\\
\
\
<span><i class="icon-time"></i>' + "" + d + "" + '' + "" + cas + "" + '</span>\\
\
\
......
and dont use 5.4 array syntax "$arr = []" please. Im working on 5.3
here you have file. maybe will be converted in you server same. http://uloz.to/x4vMeacE/schedule-phps
Thanks for the file. This almost certainly should be fixed now as it converted that file correctly.
multiline string is bad converted. on end of the line must be added "\"