Connecting Tech Pros Worldwide Help | Site Map

Making variables available within functions

  #1  
Old March 16th, 2008, 12:15 AM
Vernon Wenberg III
Guest
 
Posts: n/a
How do I make variables available to functions?

Such as in the following ...

$var = 'value';

function bla() {

echo $var;

}
  #2  
Old March 16th, 2008, 12:45 AM
Michael Fesser
Guest
 
Posts: n/a

re: Making variables available within functions


..oO(Vernon Wenberg III)
Quote:
>How do I make variables available to functions?
>
>Such as in the following ...
>
>$var = 'value';
>
>function bla() {
>
> echo $var;
>
>}
The keyword is 'global'.

Micha
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Making class attributes non-case-sensitive? Rafe answers 11 October 16th, 2008 06:05 AM
Correct C++ tutorial chapter 2.1 "Classes" available (Windows, mingw/msvc/std) Alf P. Steinbach answers 24 July 23rd, 2005 04:11 AM
Unification of Methods and Functions David MacQuigg answers 99 July 18th, 2005 12:28 PM
multiple forms within a Switch statement Angelos answers 4 July 17th, 2005 02:13 PM