<?php
$string = "Test \r\n Test";
$value = str_replace(PHP_EOL, 'NewLineCharacter', $string);
echo json_encode($value);
?>
