[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
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
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 Wong -
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 March 2004 01:44, Alex Hogan wrote:
Don't you need
[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
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 the
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 inside a function
On Tuesday 09
7 matches
Mail list logo