Remova as barras php
<?php
$str = "Is your name O\'reilly?";
// Salida: Is your name O'reilly?
echo stripslashes($str);
?>
Awful Albatross
<?php
$str = "Is your name O\'reilly?";
// Salida: Is your name O'reilly?
echo stripslashes($str);
?>
echo preg_replace('/\\\\/', '', $var);