How can I show these characters on a webpage?
A:
Can you not do the following...
<?php
echo "\n"."\n";
echo "\0"."\n";
echo "\t"."\n";
echo "\x0B"."\n";
echo "\r"."\n";
?>
Expected Result:
\n
\0
\t
\x0B
\r
and that should just print to screen, since \
is the reference for a \
on web pages.
EDIT:
Looks like StackOverflow auto-changes \
to a \ when not marked as code!
Urda
2010-02-18 14:10:45
+1
A:
// An example to replace all newlines with their character equivalent
$value = preg_replace('/[\r\n]+/', '\n', $value);
echo htmlentities($value);
Yada
2010-02-18 14:12:27