I was noticing some odd results in the output of my code that I traced back to trim(). I tested and verified my result at phptester.net (please go ahead and verify). How does the following small script give the result shown?
$x = "d1d1d1";
define("REP", "xqzxqjb1");
echo trim($x, REP); //the output is the string 'd1d1d'
//Same result if $x = 'xqzxqjb1d1d1d1xqzxqjb1' OR $x = 'd1d1d1xqzxqjb1' OR $x = 'xqzxqjb1d1d1d1';
Why isn't the output 'd1d1d1' for any of these?