欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php命令行使用方法和命令行參數(shù)說(shuō)明

 更新時(shí)間:2014年04月08日 09:39:25   作者:  
這篇文章主要介紹了php命令行使用方法和命令行參數(shù)說(shuō)明,需要的朋友可以參考下

復(fù)制代碼 代碼如下:

[root@localhost /]#
[root@localhost /]# php -r "var_dump(true);"  # 執(zhí)行PHP代碼 不需要 <?php ... ?> 標(biāo)簽
bool(true)
[root@localhost /]# php -R "var_dump(true);"  # 執(zhí)行PHP代碼 每一個(gè)輸入行

bool(true)

bool(true)

bool(true)
[root@localhost /]#
[root@localhost /]# php -f "file" # 執(zhí)行php代碼 來(lái)自文件
[root@localhost /]# 
[root@localhost /]# php "test.php" id name sex
int(4)
Array
(
    [0] => test.php
    [1] => id
    [2] => name
    [3] => sex
)
[root@localhost /]#
[root@localhost /]# cat test.php
<?php

var_dump($_SERVER["argc"]); // 獲取命令行傳入?yún)?shù)的數(shù)量
print_r($_SERVER["argv"]); // 獲取命令行傳入?yún)?shù)的數(shù)組

[root@localhost /]#

相關(guān)文章

最新評(píng)論