- strtr: documentation ( source)
<?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;