I am new in PHP world. While going through couple of functions i came across stripslash()
I am not clear about it’s benefit. Gone through couple of google link but still it’s benefit is not clear.
<?php
$array=array("a"=>"0","b"=>"1","c"=>"2");
print_r ($array);
print "\n";
foreach($array as $key=>$value)
{
print "Before stripslash : $value\n";
stripslashes($value);
print "After stripslash : $value\n";
}
print_r ($array);
?>
Output:
Array
(
[a] => 0
[b] => 1
[c] => 2
)
Before stripslash : 0
After stripslash : 0
Before stripslash : 1
After stripslash : 1
Before stripslash : 2
After stripslash : 2
Array
(
[a] => 0
[b] => 1
[c] => 2
)
The PHP docs clearly explain. The first example from that page: