Putting Evaluated Contents Of Include File Into Varialble

From: Date: Wed, 23 Feb 2005 16:21:19 +0000
Subject: Putting Evaluated Contents Of Include File Into Varialble
Groups: php.general 
Request: Send a blank email to php-general+get-209246@lists.php.net to get a copy of this message
Try using a function to do that. My code looks like: anyPHP.php: .... <your code stuff> ... Include ("yourCode.php") $variable=yourCodeFunction([params]); Then yourCode.php could be: function myFunction($param=0){ <code> return $ToSetTheVariable; } I hope this helps you... -----Mensaje original----- De: Michael Stearne [mailto:mstearne@gmail.com] Enviado el: miércoles, 23 de febrero de 2005 8:39 Para: php-general@lists.php.net Asunto: [PHP] Putting Evaluated Contents Of Include File Into Varialble Hi, I have an file that contains PHP code..variables, db, etc. Is it possible to include the evaluted contents of that file into a variable in another, the calling PHP script? Essentailly I am looking to do something like include("myCode.php") -> HTML Output -> $myVariable. I know could do this with something like $myVariable=file_get_contents("http://localhost/myCode.php") but I am not allowed to use urls in file opens. Any suggestions? Thanks, Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#209246) next »