RE: [PHP] Variables inside a function

2004-03-08 Thread Alex Hogan
My mistake. Good one on the spelling I can't believe I missed that one alex hogan > -Original Message- > From: Jason Wong [mailto:[EMAIL PROTECTED] > Sent: Monday, March 08, 2004 12:26 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Variables insid

Re: [PHP] Variables inside a function

2004-03-08 Thread Jason Wong
On Tuesday 09 March 2004 02:03, Alex Hogan wrote: > If I read his post correctly he was looking to make blah() available and > not $blah. The OP says "so that I can use $blah anywhere in the script?", which to me means that $blah needs to be global ... [snip] > Of course obviously being one of

RE: [PHP] Variables inside a function

2004-03-08 Thread Jay Blanchard
[snip] I then echo $blah; somewhere else in the script but nothing is echo'd. How do I make it so that I can use $blah anywhere in the script? [/snip] I went back and re-read the post, and his question above is the important one First you must return something from the function, then you must

RE: [PHP] Variables inside a function

2004-03-08 Thread Alex Hogan
ndensintion..., maybe I can return the favor sometime. alex hogan > -Original Message- > From: Jason Wong [mailto:[EMAIL PROTECTED] > Sent: Monday, March 08, 2004 11:49 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Variables inside a function > > On Tuesday 09 Ma

Re: [PHP] Variables inside a function

2004-03-08 Thread Jason Wong
On Tuesday 09 March 2004 01:44, Alex Hogan wrote: > Don't you need to set a return? > > Return $blah; > > At the bottom of your function block. That does not make the variable $blah available elsewhere in the program. The OP should take a look at manual > Variables > Variable scope. -- Jason Wo

RE: [PHP] Variables inside a function

2004-03-08 Thread Alex Hogan
Don't you need to set a return? Return $blah; At the bottom of your function block. alex hogan > -Original Message- > From: Nathan Croker [mailto:[EMAIL PROTECTED] > Sent: Sunday, March 07, 2004 6:18 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Variables inside a function > > I am r

RE: [PHP] Variables inside a function

2004-03-08 Thread Jay Blanchard
[snip] eg. function blah ($bl,$ah) { $bl++; $ah++; $blah=$bl+$ah; } [/snip] function blah ($bl,$ah) { $bl++; $ah++; $blah=$bl+$ah; return $blah; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php