note 46748 added to tutorial.useful

From: Date: Fri, 22 Oct 2004 02:50:05 +0000
Subject: note 46748 added to tutorial.useful
Groups: php.notes 
Request: Send a blank email to php-notes+get-78918@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/tutorial.useful.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+46748 Delete -- http://master.php.net/manage/user-notes.php?action=delete+46748&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46748&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46748&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46748&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46748&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46748&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+46748&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#78918) next »