- stripslashes: documentation ( source)
- print_r: documentation ( source)
<?php
class a{
function strip_slashes_recursive( $variable )
{
if ( is_string( $variable ) )
return stripslashes( $variable ) ;
if ( is_array( $variable ) )
foreach( $variable as $i => $value )
$variable[ $i ] = $this->strip_slashes_recursive( $value ) ;
return $variable ;
}
}
$a = new a();
$array = array("f\\'oo", "b\\'ar", array("fo\\'o", "b\\'ar"));
$array = $a->strip_slashes_recursive($array);
print_r($array);
?>