Geeks Talk

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.

php

This is a discussion on php within the PHP forums, part of the Web Development category; What all the global variables in PHP?...

Go Back   Geeks Talk > Web Development > PHP
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

PHP PHP - The most popular scripting language. Discuss PHP related questions here. Sample Scripts, Popular downloads, tools and utilites and more...

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-28-2009
Junior Member
 
Join Date: Apr 2009
Location: bangalore
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
angadi.basavaraj is on a distinguished road
php

What all the global variables in PHP?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-25-2009
Expert Member
 
Join Date: May 2009
Location: Bangalore
Posts: 984
Thanks: 155
Thanked 420 Times in 201 Posts
rijus is just really nicerijus is just really nicerijus is just really nicerijus is just really nicerijus is just really nice
Re: php

Quote:
Originally Posted by angadi.basavaraj View Post
What all the global variables in 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.
Reply With Quote
The Following User Says Thank You to rijus For This Useful Post:
Reply

  Geeks Talk > Web Development > PHP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -4. The time now is 07:13 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved