Link to home
Start Free TrialLog in
Avatar of badalpatel
badalpatel

asked on

Define Global variables in PHP

Hi,

I am completely new in PHP.
And want to create the global variable for my web application scripts that can be accessed anywhere in web application.
It should have less overhead in terms of memory
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Also, if you have even a little programming experience and want to get a foundation in PHP, get this book and work thru the examples.  Excellent learning materials!
http://www.sitepoint.com/books/phpmysql4/

Best regards, ~Ray
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Beverley Portlock
Beverley Portlock
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Let me also echo bportlock's wise advice about good coding practices.  PHP5 has a fairly useful OOP structure.  However as I try to read between the lines of the question, I am thinking that the question is about passing data from page to page of the same web site.  The session handler is a good place to start learning about how to do this.  After that, learning about cookies and data bases would probably be a good next step.
http://us.php.net/manual/en/ref.session.php

Best of luck with your project, and please post back if you have any specific questions.  ~Ray