[PHP]
/**
* Filter results according to given instruction
*
* @access private
* @param object $result (reference)
* @return object $filteredResult
*/
function &filterResults(&$result) { // STATIC OBJECT ARRAY
METHOD
global $section;
list($willFilterByLetter, $letter) =
array($_REQUEST['willFilterByLetter'], $_REQUEST['letter']);
if ($willFilterByLetter && preg_match('/[a-z]/i', $letter)) {
$filterAt = $this->filterAtArray[$section];
array_walk($result, create_function('&$a', 'global $filterAt,
$letter; if (!preg_match("/^$letter/i", $a->$filterAt)) unset($a);'));
}
return $result;
}
[/PHP]
I can't obtain $filterAt within the create_function()-created function
within array_walk(), yet I can obtain $letter. I verified this via
using print_r to show that $letter exists while $filterAt does not,
however, $filterAt DOES exist prior to array_walk().
Could someone tell me what I did wrong?
Thanx
Phil