RE: [PHP] Executing a string with both html and php inside it..
| From: | Mark Roedel | Date: | Thu, 15 Mar 2001 14:15:32 +0000 |
| Subject: | RE: [PHP] Executing a string with both html and php inside it.. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-44027@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Aviv Revach [mailto:aviv_r@brillianet.com]
> Sent: Tuesday, March 13, 2001 5:36 PM
> To: php-general@lists.php.net
> Subject: [PHP] Executing a string with both html and php inside it..
>
>
> What should I do in order to execute the next string:
> $str = "<html>\n"
> $str .= "blabla\n";
> $str .= " <?php echo \"hello!\"; ?>\n";
> $str .= "blabla\n";
> $str .= "</html>\n";
>
> When I tried using 'echo' with the string, but the php code
> didn't work...
>
> Is there any way of doing this without writing this string to a file
> and include'ing it? (that would be rather slow!)
If you're not going to be writing it out to a file, why wouldn't you
just
$str = "<html>\n"
$str .= "blabla\n";
$str .= " hello!\n";
$str .= "blabla\n";
$str .= "</html>\n";
Is there something i'm missing here? I'm sure this is an oversimplified
example, but what is it you're actually trying to accomplish?
---
Mark Roedel | "I know the answer! The answer lies within the
Systems Programmer | heart of all mankind! The answer is twelve?!?
LeTourneau University | I think I'm in the wrong building."
Longview, Texas, USA | -- Peppermint Patty (Charles Schultz)