|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Been working on a small script and have ran into a small problem. How do I make variables global to all functions inside a class? I tried global $somevar but that didn't seem to work. Any help would be appreciated. Thanks
![]()
__________________
![]() ![]() "Only Linux users see the end of crashes." - Pl4t0 |
|
#2
|
||||
|
||||
|
war.. the only thing I could find is that you could declare the globals before starting the class.. then using them within the class...
this page shows a small example of that.. other than that I'm not too sure... sorry.. I'm still learning about classes :P hope this helps ![]() http://www.webkreator.com/php/techn...-variables.html |
|
#3
|
|||
|
|||
|
classes are still a fairly new concept to me, however, i think it goes like...
PHP Code:
__________________
-Alexander |
|
#4
|
|||
|
|||
|
How do I make variables global to all functions inside a class:
$a_help="me"; $a_me="help"; class how_do{ var $a_help; var $a_me; function how_do() { global $b_help, $b_me; $this->a_help = $b_help; $this->b_me = $b_me; } } i hope it will help u ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Global Variables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|