Posts

Showing posts with the label text

Script Type PHP :)

Update 2008/03/15 I have removed preg_replace and added DOM classes to parse and manage, in a better way, script nodes that contain php code. Everything inside a simple PHP 5 compatible class . Finally, please remember that this is a layer between <?php ?> and JavaScript, and only an experiment ;) Here you can read another example, where difference between server, output, and client, should be more clear than precedent one. <?php require ' PHPScriptHandler.php '; ?> <html> <head> <title>Hello PHP World</title> <script type="text/php" author="andr3a"> // here we are between the server and output, known as client $hello = ucwords('hello php world'); // imagine that we would like to use a variable // defined somewhere in the server global $something; // we could even include or require php ...