note 46748 deleted from tutorial.useful by betz
| From: | betz@php.net | Date: | Thu, 02 Dec 2004 01:11:10 +0000 |
| Subject: | note 46748 deleted from tutorial.useful by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-81258@lists.php.net to get a copy of this message | ||
Note Submitter: jtgalkowski at alum dot mit dot edu
----
It is unfortunately true that the HTML mode within PHP does not make the HTML a "first class
citizen" as the examples with if ... then ... else ... above imply. In particular, the text in
between "?> ... <?php" is not grouped in any way, even if one were to wrap an extra
set of braces about it. This limits it.
For instance, one might want to create a function foo( $key, $continuation ) which does some session
hacking using $key. If it loses, y'might want it to finish off the page it's REQUIREd in
by spitting out some message and finishing with "?></BODY></HTML><?php ...
?>". If it wins, y'might want to be able to pass the entirety of the remainder of the
PHP file excepting a trailing
<?php
) ;
?>
as the second parameter to foo. This can't be done because there's nothing in PHP that
allows that group between the beginning of the second argument in the call to foo and the above
ending to be recognized as a clump.
If it were a constant, you could use PERLDOC-style string specification. But such a string has no
substitutions performed in it. Alas.
This is where LISP has an advantage over the present day PHP.