PHP Global VAR.?
|
how to get a golbal var. while running insude a function? "global VAR;"is not working!!! Is there another way? YoGa |
Re: PHP Global VAR.?
Link |
by
on 2005-08-16 19:49:55 (edited 2005-08-16 19:50:45)
|
<?php $var1 = 1; $var2 = 2; function addOneTo($input) { global $var1; return $input + $var1 + $var2; } print addOneTo(10); // should print 11 not 13 ?> |
Re: PHP Global VAR.?
|
THANKS VERY MUCH!!! The problem was very simple than that!! The problem was that I wrote "global var;" insteat of "global $var;". Thanks again. YoGa |