> -----Original Message-----
> From: Aviv Revach [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 13, 2001 5:36 PM
> To: [EMAIL PROTECTED]
> 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) 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to