RE: [PHP] Can Variables be in functions?

From: Date: Tue, 26 Dec 2000 17:37:14 +0000
Subject: RE: [PHP] Can Variables be in functions?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-31854@lists.php.net to get a copy of this message
Unless you either define $footercontent within myExit or add it as a global, it's out of scope within the function. Try : function myExit(){ $global $footercontent; print("</table>$footercontent"); exit; } But IMHO this is a more structured way of doing it. function myExit($footercontent){ print("</table>$footercontent"); exit; } Either should work though. Cal -----Original Message----- From: Brandon Orther [mailto:brandon@webintellects.com] Sent: Sunday, December 26, 1999 11:33 AM To: PHP User Group Subject: [PHP] Can Variables be in functions? I have a function as follows: function myExit(){ print("</table>$footercontent"); exit; } $footercontent does have the footer information in it because I echo it right before I make the function. when I use the function all it echoes is: </table> Anyone want to tell me what I'm doing wrong this time? Thanks Thank you, -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager brandon@webintellects.com 800-994-6364 www.webintellects.com -------------------------------------------- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#31854) next »