Re: Can Variables be in functions?

From: Date: Sat, 21 Apr 2001 09:51:37 +0000
Subject: Re: Can Variables be in functions?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-49653@lists.php.net to get a copy of this message
Classic Global function definition problem inside the function, insert the line global $footercontent; Also technically, the exit command can be quite messy, a 'cleaner' method would be to use something like function generate_footer() { ?> <!-- footer --> </BODY> </HTML> <? } and then call it at the end of your script, or if using case statements for many functions, then call it once at the bottom <? // Could consider using a common header function here switch($something) { case "First_Option": first_code(); break; case "Second_Option": second_thing(); break default: content($loginID); } generate_footer(); ?> Hope this helps Kevin Williams ----- Original Message ----- From: "Brandon Orther" <brandon@webintellects.com> To: "PHP User Group" <php-general@lists.php.net> Sent: Sunday, December 26, 1999 6:33 PM 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 (#49653) next »