Escaping shell metacharacters : escapeshellcmd « Utility Function « PHP






Escaping shell metacharacters

 
<?php
system('ls -al '.escapeshellarg($directory));
system(escapeshellcmd($ls_program).' -al');
?>
  
  








Related examples in the same category

1.Escaping User Input with the escapeshellcmd() Function
2.Executing df and displaying the results
3.string escapeshellcmd ( string command ) escapes special characters in shell commands