UNPKG
manual-php
Version:
latest (1.0.3)
1.0.3
1.0.2
1.0.1
PHP 手册
github.com/kuriv/manual-php
kuriv/manual-php
manual-php
/
book
/
docs
/
语言参考
/
预定义变量
/
$argv.md
25 lines
(17 loc)
•
327 B
Markdown
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# $argv
`
$argv
` 是包含当运行于命令行下时传递给当前脚本的参数的数组。 ```php
<?php
var_dump
(
$argv
); ``` 当执行 `php index.php foo bar` 这条命令时,以上例程的输出类似于: ```
array
(
3
) { [
0
]=>
string
(
9
)
"index.php"
[
1
]=>
string
(
3
)
"foo"
[
2
]=>
string
(
3
)
"bar"
} ```