1 2 3 4 5 6 7
<?php $input = "the quick | brown \ fox jumped"; echo strtr($input, array( '|' => '\\|', '\\' => '\\\\' ));
1
the quick \| brown \\ fox jumped