|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
i ask for one question:
how can i modify a global variable for example i have some like that: <?php $global_var=5 if(something) $global_var=0; else $global_var=10; display(); function display() { global $global_var; echo $global_var; } ?> the result should be 0 or 10 but in my case is 5; What should i do? |
|
#2
|
|||
|
|||
|
instead of having
if(something) try this if($global_var) |
|
#3
|
|||
|
|||
|
Not sure what you're doing wrong...
I'm not sure whats wrong, because for me, the script works as you expected it would.
Post a specific code example? -Jeff S |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > php global variables help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|