Explicit Server-Side Code (PHP)
Within activity language code, you can include your own explicit server-side statements or expressions using the PHP language. Explicit PHP code is denoted by a block of code bracketed by the start symbol "PHP<" and the end symbol ">PHP"  (see Formats below). Because PHP is a server-side language, Exotool automatatically adds explicit PHP code to the server-side portion of the application and automatically passes arguments and/or results back and forth to and from the server as/when/if necessary.
Statements vs. Expressions
Explicit PHP code is treated either as a statement or as an expression depending on the context in which it is used.  (see Examples below) In either case, the text within the block acts like the body of a function definition, with the difference that in the case of use as an expression, you must use a return statement to pass back the returned value.  (see Examples below)Arguments and Outputs
Using Exotool variables acting as arguments and outputs to exlicit PHP code is done via accesses to $args and $outputs that appear as objects. Indeed, you MUST use these in order to indicate to exotool what must be passed back and forth. Exotool searches the php code to find references to $args->xxx and $outputs->xxx to discover which variables the user's code will read or write.In a statement definied using explicit PHP, the special objects $args and $outputs may be used. In an expression, $args may be used, and the output is specified with a return([value]) statement.
Format:
PHP< ...php code...>PHP
Examples
// get the time from the server using a PHP expression:
time_string = PHP< return(date("m/d/y",time())); >PHP
// read a file using a PHP expression: file_contents = PHP< $s = file_get_contents($args->the_file_name); return($s); >PHP
// a PHP explicit statement for a = b+c : PHP< $outputs->a = $args->b + $args->c; >PHP