简体   繁体   中英

call command line program with php

I have a program running on my command line. The program allows one to type in a username and returns a bunch of information pertaining to that user. I assume it is possible to access this program from php, and even store the information in a variable. Anyone know how to do this though?

Thanks in advance for the advice

阅读system()exec()的文档,它应该是您所需要的。

This link should help you. A quick example:

<?php
  $out = array();
  exec = ('ls /ver 2>&1', $out);
  print_r($out);
?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM