當(dāng)前位置:工程項(xiàng)目OA系統(tǒng) > 泛普各地 > 江西OA系統(tǒng) > 新余OA > 新余網(wǎng)站建設(shè)公司
PHP調(diào)用Linux系統(tǒng)的常用函數(shù)
申請(qǐng)免費(fèi)試用、咨詢電話:400-8352-114
PHP調(diào)用Linux系統(tǒng)的常用函數(shù)1、exec函數(shù)
<?php
$test = "ls /tmp/test"; //ls是linux下的查目錄,文件的命令
exec($test,$array); //執(zhí)行命令
print_r($array);
?>
2、system函數(shù)
<?php
$test = "ls /tmp/test";
$last = system($test);
print "last: $lastn";
?>
3、passthru函數(shù)
<?php
$test = "ls /tmp/test";
passthru($test);
?>
4、popen函數(shù)
<?php
$test = "ls /tmp/test";
$fp = popen($test,"r"); //popen打一個(gè)進(jìn)程通道
while (!feof($fp)) { //從通道里面取得東西
$out = fgets($fp, 4096);
echo $out; //打印出來(lái)
}
pclose($fp);
?>
5、proc_open函數(shù)
<?php
$test = "ls /tmp/test";
$arrayarray = array(
array("pipe","r"), //標(biāo)準(zhǔn)輸入
array("pipe","w"), //標(biāo)準(zhǔn)輸出內(nèi)容
array("pipe","w") //標(biāo)準(zhǔn)輸出錯(cuò)誤
);
$fp = proc_open($test,$array,$pipes); //打開一個(gè)進(jìn)程通道
echo stream_get_contents($pipes[1]); //為什么是$pipes[1],因?yàn)?是輸出內(nèi)容
proc_close($fp);
?>
6、proc_open函數(shù)
<?php
$test = "ls /tmp/test";
$arrayarray = array(
array("pipe","r"), //標(biāo)準(zhǔn)輸入
array("pipe","w"), //標(biāo)準(zhǔn)輸出內(nèi)容
array("pipe","w") //標(biāo)準(zhǔn)輸出錯(cuò)誤
);
$fp = proc_open($test,$array,$pipes); //打開一個(gè)進(jìn)程通道
echo stream_get_contents($pipes[1]); //為什么是$pipes[1],因?yàn)?是輸出內(nèi)容
proc_close($fp);
?>
7、shell_exec函數(shù)
<?php
$test = "ls /tmp/test";
$out = shell_exec($test);
echo $out;
?>
- 1萬(wàn)網(wǎng)中,如何查看郵箱賬號(hào)登錄網(wǎng)頁(yè)版日志
- 2為什么網(wǎng)站被百度降權(quán)
- 3怎樣用Jquery 判斷radio,selelct,checkbox是否選中
- 4網(wǎng)絡(luò)營(yíng)銷的服務(wù)構(gòu)成
- 5網(wǎng)站相關(guān)性對(duì)網(wǎng)站質(zhì)量的影響
- 6高權(quán)重的網(wǎng)站的表現(xiàn)
- 7養(yǎng)成幾條PHP編程好習(xí)慣
- 8關(guān)于落實(shí)對(duì)已注冊(cè)國(guó)內(nèi)域名開展實(shí)名制清查的緊急通知
- 9企業(yè)為什么須要權(quán)威的網(wǎng)站設(shè)計(jì)單位做官方網(wǎng)站呢?
- 10企業(yè)要打造營(yíng)銷型企業(yè)網(wǎng)站
- 11企業(yè)網(wǎng)站營(yíng)銷運(yùn)營(yíng)最重要
- 12配置CKEditor和CKFinder
- 13做網(wǎng)站優(yōu)化必知三點(diǎn)
- 14阿里云備案 客戶應(yīng)準(zhǔn)備的資料
- 15PHP與JAVA相比,哪個(gè)是高端OA軟件御用語(yǔ)言
- 16網(wǎng)站建設(shè)順利四大原則
- 17網(wǎng)站建設(shè)之網(wǎng)站定位
- 18企業(yè)為什么偏偏要專門的網(wǎng)站設(shè)計(jì)企業(yè)做網(wǎng)站呢?
- 19網(wǎng)站運(yùn)營(yíng)離不開網(wǎng)站數(shù)據(jù)
- 20三種方法使PHP生成靜態(tài)html文件
- 21企業(yè)網(wǎng)站運(yùn)營(yíng)計(jì)劃的分析
- 22JavaScript的優(yōu)化準(zhǔn)則
- 23企業(yè)應(yīng)用架構(gòu)模式
- 24新余視頻網(wǎng)站解決方案
- 25Discuz!二次開發(fā)添加后臺(tái)管理模塊
- 26系統(tǒng)的二次開發(fā)、初試ECSHOP制作模板
- 27網(wǎng)站內(nèi)部?jī)?yōu)化一點(diǎn)小總結(jié)
- 28網(wǎng)站優(yōu)化中幾個(gè)誤區(qū)
- 29PHP與MySQL數(shù)據(jù)庫(kù)中排序的比照
- 30怎樣測(cè)試美國(guó)主機(jī)速度
成都公司:成都市成華區(qū)建設(shè)南路160號(hào)1層9號(hào)
重慶公司:重慶市江北區(qū)紅旗河溝華創(chuàng)商務(wù)大廈18樓