PHP 快速導覽 - 核心延伸函數 程式執行相關 exec()





































PHP 快速導覽 - 核心延伸函數 程式執行相關 exec()






內建函數 (function) exec() 執行參數的系統指令,執行結果回傳為字串,或將結果儲存在提供的陣列中










函數說明
string exec(string $command [, array &$output [, int &$return_var]])$command 系統指令, $output 為儲存結果的陣列。



參數 (parameter) 為系統指令及陣列,須注意回傳的是字串。


舉例如下
<?php
echo exec('whoami', $a) . "n";
print_r($a)

/* 《程式語言教學誌》的範例程式
http://pydoing.blogspot.com/
檔名:program03.php
功能:示範 PHP 程式
作者:張凱慶
時間:西元 2013 年 2 月 */
?>



執行結果如下















中英文術語對照
函數function
參數parameter



您可以繼續參考
程式執行相關

  • escapeshellarg()

  • escapeshellcmd()

  • exec()

  • passthru()

  • proc_close()

  • proc_get_status()

  • proc_nice()

  • proc_open()

  • proc_terminate()

  • shell_exec()

  • system()





相關目錄

回 PHP 快速導覽
回 PHP 教材
回首頁



參考資料

http://www.php.net/manual/en/function.exec.php







沒有留言:




















window.___gcfg = { 'lang': 'zh-TW' };





Popular posts from this blog

迅雷 Thunder 7.9.43.5054 免安裝版 (9.1.41.914 安裝版) - 支援BT下載的萬用 檔案下載工具

qBittorrent 4.1.1 免安裝中文版 - 取代uTorrent的BT下載器

嘸蝦米輸入法免安裝版 1.0.13.589 - 唯一只用英文字母輸入的中文輸入法