RE: [PHP] Retrieve output from HTML or PHP file
| From: | Peter Lauri | Date: | Mon, 30 Jan 2006 05:16:18 +0000 |
| Subject: | RE: [PHP] Retrieve output from HTML or PHP file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-229440@lists.php.net to get a copy of this message | ||
Hi Chris,
As I read in the documentation it only takes the content of the file. If
there is a script in the file I want that to be fun first. A file like this:
----------
HTLM content
<?php echo 'Hello World'; ?>
HTML content
----------
I want the result from my function to be
----------
HTLM content
Hello World
HTML content
----------
The file_get_contents('file.html') will give me
----------
HTLM content
<?php echo 'Hello World'; ?>
HTML content
----------
Or am I not correct?
Best regards,
Peter Lauri
-----Original Message-----
From: Chris [mailto:dmagick@gmail.com]
Sent: Monday, January 30, 2006 11:49 AM
To: Peter Lauri
Cc: php-general@lists.php.net
Subject: Re: [PHP] Retrieve output from HTML or PHP file
Hi Peter,
Close :)
file('file.html');
see http://www.php.net/file
or
file_get_contents('file.html');
see http://www.php.net/file_get_contents
the 'file' function returns an array, 'file_get_contents' returns it as
a string.
Peter Lauri wrote:
> Best group member,
>
>
>
> I have a php script running and need to save the output from an HTML-file
or
> PHP-file. What I want to do:
>
>
>
> $the_output = thenicefunction('file.html');
>
>
>
> Any suggestions?
>
>
>
> /Peter