PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

$argv> <$http_response_header
Last updated: Fri, 22 Aug 2008

view this page in

$argc

$argcスクリプトに渡された引数の数

説明

コマンドラインから実行したときに、 現在のスクリプトに渡された引数の数が含まれます。

注意: スクリプトのファイル名は、常にスクリプトへの引数として渡されます。 したがって、$argc の最小値は 1 です。

注意: この変数は、register_argc_argv が有効になっている場合にのみ使用可能です。

例1 $argc の例

<?php
var_dump
($argc);
?>

このサンプルを php script.php arg1 arg2 arg3 と実行します。

上の例の出力は、たとえば 以下のようになります。

int(4)



add a note add a note User Contributed Notes
$argc
There are no user contributed notes for this page.

$argv> <$http_response_header
Last updated: Fri, 22 Aug 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites