Executing df and displaying the results : escapeshellcmd « Utility Function « PHP






Executing df and displaying the results

 
<?php
exec(escapeshellcmd("df"),$output_lines,$return_value);
echo ("Command returned a value of $return_value.");
echo "</pre>";
foreach ($output_lines as $output) {
    echo "$o";
}
echo "</pre>";
?>
  
  








Related examples in the same category

1.Escaping shell metacharacters
2.Escaping User Input with the escapeshellcmd() Function
3.string escapeshellcmd ( string command ) escapes special characters in shell commands