Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on php within the PHP forums, part of the Web Development category; What all the global variables in PHP?...
|
|||||||
| PHP PHP - The most popular scripting language. Discuss PHP related questions here. Sample Scripts, Popular downloads, tools and utilites and more... |
![]() |
| LinkBack | Thread Tools | Display Modes |
|
|||
|
Re: php
Hi Basavaraj, I'll give u an example related to global variable... <?php $a = 1; $b = 2; function Sum() { global $a, $b; $b = $a + $b; } Sum(); echo $b; ?> The above script will output 3. By declaring $a and $b global within the function, all references to either variable will refer to the global version. There is no limit to the number of global variables that can be manipulated by a function. I think the example will resole your query..... Thanks, Riju. |
| The Following User Says Thank You to rijus For This Useful Post: | ||
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|