/*********************************************************************
 *                  PHP 反引号运行Shell命令,C程序
 * 说明:
 *     之前没有注意到PHP可以直接运行反引号来执行shell命令,这个倒是让
 * 代码简洁了不少,因为最近在PHP里面执行shell命令用的多。
 *
 *                                   2017-8-10 深圳 龙华樟坑村 曾剑锋
 ********************************************************************/


一、参考文档:
    1. Call a C program from php and read program output
        https://stackoverflow.com/questions/5555912/call-a-c-program-from-php-and-read-program-output

二、处理方法:
    1. $output = shell_exec('/path/to/your/program');
    2. $output = `/path/to/your/program`;    // 这种之前一直没想过,这种貌似更简洁的样子

三、处理字符串连接:
    "zengjf".`/path/to/your/program`

 

相关文章:

  • 2022-12-23
  • 2021-06-25
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2021-04-29
  • 2022-12-23
  • 2021-05-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案