3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = "dsafdsfjasdkfjlk;ds"; $string = str_replace("\n", "<br />", $string); foreach (array('pre', 'code') as $tag) { if(preg_match_all("/$tag>(.*?)<\/$tag/", $string, $match)) { foreach($match as $a){ foreach($a as $b){ $string = str_replace("<$tag>".$b."</$tag>", "<$tag>".str_replace("<br />", "", $b)."</$tag>", $string); } } } } return $string;
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0