I am trying to read the contents of a "PHP" page for an audio player
and put it into a textarea to be copied and pasted into an "HTML"
page.
The trouble is the textarea shows unparsed PHP code and I just want the HTML.
The code is:
$player = file_get_contents('player.php');
//Strip out unnecessary HTML Code
if(preg_match('/<!-- Start Player Code -->(.*)<!-- End Player Code
-->/s', $player, $matches)) {
$code = $matches[1];
}
echo "<textarea name=\"textarea\" cols=\"70\" rows=\"15\">" . $code .
"</textarea>";
echo "<BR>";
echo "<a href=\"player.php\">Click Here</a> to view the player \n";
Looked at using eval() but found this:
Kepp the following Quote in mind:
If eval() is the answer, you're almost certainly asking the
wrong question. -- Rasmus Lerdorf, BDFL of PHP
(Hmmm...)
Any help much appreciated.
Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php