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
On Friday 03 January 2003 09:17 am, Shawn McKenzie wrote:
> 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.
you'd probably have to fopen/fgets or file, and then parse for the function
start and end and read the contents.
What??? I want to read the code from the function into a string!
"Peter Houchin" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> so put it in a if or switch statement
>
> eg
>
> if ($var){
> myfunction();
> }
> else {
> sumotherfunction();
> }
>
> etc
>
>
> >
so put it in a if or switch statement
eg
if ($var){
myfunction();
}
else {
sumotherfunction();
}
etc
> -Original Message-
> From: Shawn McKenzie [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 3 January 2003 12:18 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Code contents of a function
>
4 matches
Mail list logo