So I have the following:
<?foreach($letter_array as $letter) {
$cur = $letter;
$alpha_array = array_values(array_filter($map_array, create_function('$var', 'global $cur; return $var["name"]{0} == $cur;')));
?>
Obviously there is more code but that's good enough to troubleshoot this problem. $cur should equal the current alphabet letter I'm on. I use this to filter results from $map_array. For some reason $cur, which verifiably contains the letter, will not work in the create_function. If I hard code the value for $cur, it works. So it has something to do with using a variable from a loop. Any ideas?
JP