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
[EMAIL PROTECTED]



"Cam Dunstan" <[EMAIL PROTECTED]> 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" <[EMAIL PROTECTED]>
> To: "Philipp Bolliger" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> 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
> 


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to