shell_exec- Run the command through the shell and return the full output as a string. The output is output to the terminal.
So this is:
<?php
$output = shell_exec('ls -lart');
echo "<pre>$output</pre>";
?>
Will return ls -lart of your directory. If you do the same with the exit gedit, these will only be error messages and warnings, because gedit returns the text to the graphical interface, and not to the terminal.
, cat
<?php
$output = shell_exec('cat ' . $filename');
echo "<pre>$output</pre>";
?>
.
<?php
$myfile = fopen("webdictionary.txt", "r") or die("Unable to open file!");
echo fread($myfile,filesize("webdictionary.txt"));
fclose($myfile);
?>
PHP