Search code examples
phphidden-characters

PHP - how can I show \n \0 \t \x0B \r


How can I show these characters on a webpage?


Solution

  • // An example to replace all newlines with their character equivalent
    $value = preg_replace('/[\r\n]+/', '\n', $value);
    echo htmlentities($value);