3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = "Hello world Line break occurred! smartcrop>>> This is the third line. Literal --> \\n <-- here "; $translator1 = ['smartcrop>>>' => '', '\n' => '']; $translator2 = ['smartcrop>>>' => '', "\n" => '']; echo $string; echo PHP_EOL; echo strtr($string, $translator1); echo PHP_EOL; echo strtr($string, $translator2); echo PHP_EOL;
Output for 5.6.0 - 7.2.6
Hello world Line break occurred! smartcrop>>> This is the third line. Literal --> \n <-- here Hello world Line break occurred! This is the third line. Literal --> <-- here Hello worldLine break occurred! This is the third line.Literal --> \n <-- here