Connecting Tech Pros Worldwide Help | Site Map

Making variables available within functions

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 15th, 2008, 11:15 PM
Vernon Wenberg III
Guest
 
Posts: n/a
Default Making variables available within functions

How do I make variables available to functions?

Such as in the following ...

$var = 'value';

function bla() {

echo $var;

}

  #2  
Old March 15th, 2008, 11:45 PM
Michael Fesser
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.