I have an array that has "formname" in it as a $key. When I execute the following function:
function in_array_r($needle, $arr, $strict = true) {
$form_id = $lead['form_id'];
$user_id = $lead['id'];
$attachments = array();
$arr=get_defined_vars();
$needle="formna1me";
foreach ($arr as $item) {
if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && in_array_r($needle, $item, $strict))) {
echo "found"; exit;
}
}
echo "notfound"; exit;
}
It returns "found" as it should. But if I change the $needle
to $needle = "bbrubrcuyrfbur"
it also returns found. It is simply always returning found? Not sure what is wrong.