Question for an interpret function
| From: | Jacobo Benitez | Date: | Tue, 09 Jul 2002 00:04:07 +0000 |
| Subject: | Question for an interpret function | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-11211@lists.php.net to get a copy of this message | ||
Hello
Im doing a program, but I need to create an html document that have results of php code.
Example:
I have a file that name is: copy.inc
In this file I have that code:
============ copy.inc =============
<?php
for ($i=1; $i<=9; $i++) {
echo "Hello<br>\n";
}
?>
===================================
And I want to copy the code that copy.inc have to another file named: copy.html
Here is how I copy the code:
I have another file named: copy.php
============ copy.php =============
<?php
$file = fopen("copy.inc","r");
$source = fread($file,1000000);
fclose($thefile);
$copy = fopen("copy.html","w");
fwrite($copy,$source);
fclose($copy);
}
?>
===================================
But when I do that, in copy.html copy the full php code, not copy the html interpreted code, how can I do to interpret the php code of copy.inc to html code before copy the code of copy.inc to copy.html?
I need that in copy.html the source be:
Hello<br>
Hello<br>
Hello<br>
Hello<br>
Hello<br>
Hello<br>
Hello<br>
Hello<br>
Hello<br>
Hello<br>
no
<?php
for ($i=1; $i<=9; $i++) {
echo "Hello<br>\n";
}
?>
If you know that please e-mail me!
Thanks
Jacobo
_________________________________________________________________
Charle con sus amigos online usando MSN Messenger: http://messenger.msn.com