Re: Re: How to echo the end marker '?>'
| From: | Maxim Maletsky | Date: | Fri, 08 Nov 2002 13:36:47 +0000 |
| Subject: | Re: Re: How to echo the end marker '?>' | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-16815@lists.php.net to get a copy of this message | ||
Actually, you don't even have to concatenate them at all. Just treat <?
as a string and that is it:
eg:
<?
echo '<? echo "hello world"; ?>';
?>
will output you:
--
<? echo "hello world"; ?>
--
without any parse errors.
--
Maxim Maletsky
maxim@php.net
"Cam Dunstan" <cam@norex.com.au> wrote... :
> Ernest, your solution is quite correct, I write lots of scripts that "write
> scripts" and it works fine. just concatenate little strings together
> "<"."?"."php" and "?".">" pretty much
> as you suggested to Philipp.
>
> If you have a really sick and twisted mind you can create functions that do
> this in combination with $$ variable variables for some very interesting
> effects but after a while your friends will start crossing over to the other
> side of the road when they see you coming. If these functions write the
> scripts to disk for later execution you are entering the realms of self
> modifying code, or software that "learns". PHP has to be THE perfect
> language to experiment in this area with, surely.
>
>
>
> ----- Original Message -----
> From: "Ernest E Vogelsinger" <ernest@vogelsinger.at>
> To: "Philipp Bolliger" <phibo@freesurf.ch>
> Cc: <php-general@lists.php.net>; <php-windows@lists.php.net>
> Sent: Friday, November 08, 2002 11:25 PM
> Subject: [PHP-WIN] Re: [PHP] How to echo the end marker '?>'
>
>
> > At 12:15 08.11.2002, Philipp Bolliger spoke out and said:
> > --------------------[snip]--------------------
> > >subject's allready my question ! I want to echo something like : "<form
> > >action = \",?php echo $PHP_SELF ?> \" >" so that the action
> > >becomes <?
> > >echo $PHP_SELF ?> !! But I can't figure out how to escape ?> so that the
> > > interpreter doesn't take it as the end of the script ! Any idea ?
> > --------------------[snip]--------------------
> >
> > Try
> >
> > echo '<form action="', '<', '?', 'php echo
> > $PHP_SELF', '?', '>', '">';
> >
> > This should work (untested)
> >
> >
> > --
> > >O Ernest E. Vogelsinger
> > (\) ICQ #13394035
> > ^ http://www.vogelsinger.at/
> >
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>