In PHP, I need to declare a variable and be able to use it inside a function. Is there any way I can do this? I tried "Global $myvar=0;" but i get the following error:
Parse error: syntax error, unexpected '=', expecting ',' or ';' in C:\Program Files\EasyPHP 2.0b1\www\test.php on line 2
and if I take out the "=" ("Global $myvar=0; $new=0; echo $new;") I get this:
Parse error: syntax error, unexpected T_ECHO in C:\Program Files\EasyPHP 2.0b1\www\test.php on line 4
2007-04-03
15:46:17
·
3 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design