$argc

$argc锟斤拷锟捷革拷锟脚憋拷锟侥诧拷锟斤拷锟斤拷目

说锟斤拷

锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷时锟斤拷锟捷革拷锟斤拷前锟脚憋拷锟侥诧拷锟斤拷锟斤拷锟斤拷目锟斤拷

Note: 锟脚憋拷锟斤拷锟侥硷拷锟斤拷锟斤拷锟斤拷锟斤拷为锟斤拷锟斤拷锟斤拷锟捷革拷锟斤拷前锟脚憋拷锟斤拷锟斤拷锟� $argc 锟斤拷锟斤拷小值为 1锟斤拷

Note: 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟� register_argc_argv 锟斤拷时锟斤拷锟矫★拷

锟斤拷锟斤拷

Example #1 $argc 锟斤拷锟斤拷

<?php
var_dump
($argc);
?>

锟斤拷使锟斤拷锟斤拷锟斤拷锟斤拷锟街达拷锟�: php script.php arg1 arg2 arg3

锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�

int(4)

注锟斤拷

Note:

也锟斤拷锟斤拷锟斤拷 $_SERVER['argc'] 锟叫伙拷取锟斤拷

锟轿硷拷

  • getopt() - 锟斤拷锟斤拷锟斤拷锟叫诧拷锟斤拷锟叫憋拷锟叫伙拷取选锟斤拷
  • $argv