Lecture
PHP supports one statement of execution: backquotes (``). Note that these are not single quotes. PHP tries to execute a string enclosed in back quotes as a console command, and returns the output (i.e., it is not just issued at the output, but, for example, can be assigned to a variable). Using backquotes is similar to using shell_exec () .
<?php
$output = `ls -al`;
echo "<pre>$output</pre>";
?>
Note: back quotes are not available if the safe mode is set or the shell_exec () function is disabled .
See also: functions for executing programs, popen () proc_open () .
Comments
To leave a comment
Running server side scripts using PHP as an example (LAMP)
Terms: Running server side scripts using PHP as an example (LAMP)