Executing External Applications Using exec()
<?php exec("ls /foo/", $output, $return_val); echo "Exit code of: $return_val\n"; ?>