alla fine ci sono riuscito, se a qualcuno può servire, posso visualizzare il carattere "\" ovvero lo slash usando il suo codice ascii:

$str = "The string ends in escape: ";
$str .= chr(92); /* add an escape character at the end of $str */
$str = sprintf("%c", 92);