I got a question about the "$key => $value" in the code below... I looked it up in google but it didn't returned any results.. All I know is that "=>" is used in arrays like x = array('a' => 'b').
function _stripslashes_rcurs($variable,$top = true)
{
$clean_data = array();
foreach($variable as $key => $value)
{
$key = ($top) ? $key : stripslashes($key);
$clean_data[$key] = (is_aray($value)) ?
stripslashes_rcurs($value, false) : stripslashes($value);
}
return $clean_data;
}
thank you for your help
Basically it's looping through $variable and setting the key as $key and the value as $value. So let's say this is your arrray:
$variable = array(
'a' => 'A'
'b' => 'B'
'c' => 'C'
);
Then in each iteration of the loop, $key would be one of the lowercase letters, and $value would be the corresponding uppercase letter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With