3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // text includes line breaks $text_with_line_breaks = "1st\n2nd\3rd\n"; $body=highlight_string ( $text_with_line_breaks, TRUE); // $body is a single line, without line breaks echo $body ?>
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<code><span style="color: #000000"> 1st<br />2ndrd<br /></span> </code>
Output for 4.3.0 - 4.4.9
<code><font color="#000000"> 1st<br />2ndrd<br /></font> </code>