note 49741 added to tutorial.useful

From: Date: Mon, 07 Feb 2005 15:37:43 +0000
Subject: note 49741 added to tutorial.useful
Groups: php.notes 
Request: Send a blank email to php-notes+get-84620@lists.php.net to get a copy of this message
I was writing my own script interpretter some years ago, and still run all my scripts through it. It actually uccurred to me that the script/html mixing is the same as thinging of "?>" as the BEGINNING of a quoted string, like "echo('" and as "<?php" as the end of a quoted string "');". So, add an implied ?> at the start of the script file and a <?php at the end, and then replace all "?>" with "echo('" and all "<?php" with "');". Of course you need a multiline string that doesn't terminate on quote characters ;). But basically this small internal step before interpretting the script torns the "mixed" file into a simple, regular program. This is basically what happens in the interpretation stage inside php. Or at least it does in my own language. ---- Manual Page -- http://www.php.net/manual/en/tutorial.useful.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+49741 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49741&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49741&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49741&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49741&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49741&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+49741&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#84620) next »