I have a function that uses lots of global vars and arrays - e.g.
$a=1; $b[0]=\'a\'; $b[1]=\'b\'; $c=\'Hello\'; function foo() { echo \"$a $b[0]
You should use the "global" keyword, which tells the compiler to look for global variables.
function foo() { **global $a, $b, $c;** echo "$a $b[0] $b[1] $c"; }