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

search for in the

استثناهای از پیش تعریف شده> <$argc
[edit] Last updated: Fri, 24 Jun 2011

view this page in

$argv

$argvآرایه آرگومان‌های داده شده به اسکریپت

Description

شامل یک آرایه array از تمام آرگومان‌ٰهای ارسال شده به اسکریپت در حال اجرا از خط فرمان.

Note: اولین آرگومان نام فایل اسکریپت فعلی است بنابراین $argv[0] نام اسکریپت است.

Note: این متغیر تنها در حالی قابل دسترسی است کهregister_argc_argv فعال باشد.

Examples

Example #1 نمونه $argv

<?php
var_dump
($argv);
?>

هنگام اجرای نمونه با: php script.php arg1 arg2 arg3

The above example will output something similar to:

array(4) {
  [0]=>
  string(10) "script.php"
  [1]=>
  string(4) "arg1"
  [2]=>
  string(4) "arg2"
  [3]=>
  string(4) "arg3"
}



استثناهای از پیش تعریف شده> <$argc
[edit] Last updated: Fri, 24 Jun 2011
 
add a note add a note User Contributed Notes $argv - [4 notes]