This code is self-explanatory. After I call the function and it works fine, other calls would fail:
<?php
function htmlFilter_array(&$html_array)
{
function nested_clean(&$value)
{
$value = htmlentities($value, ENT_QUOTES, "UTF-8");
}
array_walk_recursive($html_array, 'nested_clean');
}
$arr1=array("id"=>"1");
echo "line 1 <br/>";
$arr2=array("id"=>"2");
echo "line 2 <br/>";
$arr3=array("id"=>"3");
echo "line 3 <br/>";
htmlFilter_array($arr1);
echo "line 4 <br/>";
htmlFilter_array($arr2);
echo "line 5 <br/>";
htmlFilter_array($arr3);
echo "line 6 <br/>";
?>
this is the result:
line 1
line 2
line 3
line 4
why line 5 and 6 cannot run?