RE: [PHP4BETA] Include-like on strings
| From: | Lucas Wartenburger | Date: | Mon, 06 Mar 2000 17:55:28 +0000 |
| Subject: | RE: [PHP4BETA] Include-like on strings | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-11603@lists.php.net to get a copy of this message | ||
hi!
> I assume he has a complete page in a string...
>
> $string = "
> <?
> # etc
> # more etc
> ?>
>
> ";
>
> And would like to evaluate it as include() does on files!
>
> includes ( file );
> to
> include ( char*/string );
>
> eval() does this, but it won't treat it like include(), so
> <? and ?> will produce errors!
how about
$string="?> $string <?php ";
eval($string);
That's what I did, and it's working fine (although it doesn't look
very nice).
bye
lucas
_________________________________________________________________
email: lucas@wartenburger.de
www : http://www.wartenburger.de/
fax : +49-89-2443-20203 (vlf.net)
tel : +49-89-3123-2861 (zw.7 u.24)
icq : #5174936
pgp1 : 5E19 F0A9 E27B A465 7CF6 B86A 3B0F 10BB F4C1 3490 (DSS/DH)
pgp2 : E946 C625 8A87 CBEE EAD9 FDF1 59B0 5EFF (RSA)
addr : Weitlstr. 97a, D-80935 Muenchen