REX: Remote Execution Framework for PHP
These are code examples for REX and are hosted on the PurplePixie server.

For each one you can request the URL from REX and it will execute or view the code online.

Hello World Example

The simplest REX example - just writes 'Hello World!' via a PHP echo statement.

REX URL: http://rex.purplepixie.org/examples/hello-world/
for example: php rex.php http://rex.purplepixie.org/examples/hello-world/

Code View URL: http://rex.purplepixie.org/examples/hello-world/


Counter Example

Shows an incrementing counter through repeated calls to the same script.

Demonstrates both use of the internal REX variable stack and also use of native PHP variables in REX code.

REX URL: http://rex.purplepixie.org/examples/counter/
for example: php rex.php http://rex.purplepixie.org/examples/counter/

Code View URL: http://rex.purplepixie.org/examples/counter/


Dynamic Example

You can dynamically generate REX code (after all it's just PHP code). This example uses PHP to generate some REX code dynamically including a datetime generated by the code server (when it makes the REX file) and then an instruction to get a datetime from the client when the code is executed.

The index.rex file basically exists so you can just call the code without having to specify a particular file (in this case dynamic-rex.php).

REX URL: http://rex.purplepixie.org/examples/dynamic/
for example: php rex.php http://rex.purplepixie.org/examples/dynamic/

Code View URL: http://rex.purplepixie.org/examples/dynamic/