Why does this work:
function myfunction($v) {
$query = $v['host'] == '1';
return ( $query );
}
$output = array_filter($recordset,myfunction);
print_r($output);
Whereas this script, which tries to accomplish the same thing with variables, does not?
$column1 = 'host';
$value1 = 1;
$query1 = '$v[\''.$column1.'\'] == '.$value1;
function myfunction($v) {
$query = $GLOBALS['query1'];
return ( $query );
}
$output = array_filter($recordset,myfunction);
print_r($output);
Any help would be great. Thanks!