**** note the back ticks not single quote ******
executes the contents of the ticks as if you are at the terminal but as apache or whoever your web server is. this code basically
echo `whoami`; // well who is this script running as
echo `pwd`; // think whereami
echo `mkdir test`; // make a directory
echo `mkdir test/anothertest`; // make a directory in the directory created
echo nl2br(`ls`); // list what is in this directory
`touch log.txt`; // make a text file named log.txt
$date = date("F j, Y, g:i a");
`echo $date > log.txt`; // writes the $date to log.txt
`echo foo >> log.txt`; // writes foo to log.txt
echo nl2br(`cat log.txt`); // echoes what is in log.txt
echo nl2br(`tail /opt/local/apache2/logs/error_log`); // echoes what is in the error_log
php – The execution operator
Dec, 3 -- Categories: PHP