I have and array:
Array(
[9533]=>44
[6478]=>56
)
I want to filter the array with a variable. I have tried this:
function filterArray($value){
return ($value == $myVar);
}
$filteredArray = array_filter($myArray, 'filterArray');
print_r($filteredArray);
it just prints:
array()
if I change the variable to a hard number like 44, then it will give me what I want.
Array(
[9533]=>44
)