RE: [PHP] Variables inside a function

From: Date: Mon, 08 Mar 2004 17:44:15 +0000
Subject: RE: [PHP] Variables inside a function
Groups: php.general 
Request: Send a blank email to php-general+get-179802@lists.php.net to get a copy of this message
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:n.croker@azabia.co.uk] > Sent: Sunday, March 07, 2004 6:18 PM > To: php-general@lists.php.net > Subject: [PHP] Variables inside a function > > I am relatively new to PHP. But something I can't seem to make work is > when > I call one of the functions I have made and a variable is set inside that > function.... > eg. function blah ($bl,$ah) { > $bl++; > $ah++; > $blah=$bl+$ah; > } > 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? > > Thank you in advance for any help. > ------------------------ > Nathan Croker > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php ****************************************************************** The contents of this e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom it is addressed. The views stated herein do not necessarily represent the view of the company. If you are not the intended recipient of this e-mail you may not copy, forward, disclose, or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender. ******************************************************************

« previous php.general (#179802) next »