Re: Code contents of a function
| From: | Khalid El-Kary | Date: | Fri, 03 Jan 2003 12:09:56 +0000 |
| Subject: | Re: Code contents of a function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-130081@lists.php.net to get a copy of this message | ||
although i never needed to do such a thing, but you can open the PHP file with the file system functions fopen,fread,fgets ... and work with it using string functions strpos(),substr() ...
File system functions: http://www.php.net/manual/en/ref.filesystem.php
String functions: http://www.php.net/manual/en/ref.strings.php
good luck!
Regrads,
Khalid Al-Kary
What??? I want to read the code from the function into a string! "Peter Houchin" <php@vfsa.com.au> wrote in message news:DPEPKCNEFOKBCNNANCIPAEHGDDAA.php@vfsa.com.au... so put it in a if or switch statement eg if ($var){ myfunction(); } else { sumotherfunction(); } etc_________________________________________________________________ The new MSN 8 is here: Try it free* for 2 months http://join.msn.com/?page=dept/dialup-----Original Message----- From: Shawn McKenzie [mailto:nospam@mckenzies.net] Sent: Friday, 3 January 2003 12:18 PM To: php-general@lists.php.net Subject: [PHP] Code contents of a function I have a script with some functions and within the script I want to read the code from one of the functions into a string. Example: function myfunction() {-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpecho "something"; echo "something else"; someotherfunction();} I want to read:echo "something"; echo "something else"; someotherfunction();into a string. Any ideas??? TIA -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php