3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if (!function_exists('strip_slashes')) { /** * Un-quotes a quoted string. * * @param (mixed) $str - The input string. * @author Yousef Ismaeil Cliprz */ function strip_slashes($str) { if (is_array($str)) { foreach ($str as $key => $val) { $str[$key] = strip_slashes($val); } } else { $str = stripslashes($str); } return $str; } } $arr = array('Yousef\\\'s','\"PHP.net\"','user\\\'s'); echo 'With strip_slashes() function:<br />'; print_r(strip_slashes($arr)); echo '<br />'; echo 'Without strip_slashes() function:<br />'; print_r($arr); ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
With strip_slashes() function:<br />Array ( [0] => Yousef's [1] => "PHP.net" [2] => user's ) <br />Without strip_slashes() function:<br />Array ( [0] => Yousef\'s [1] => \"PHP.net\" [2] => user\'s )