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

search for in the

$argv> <$http_response_header
Last updated: Fri, 30 Oct 2009

view this page in

$argc

$argcDie Anzahl der an das Skript übergebenen Argumente

Beschreibung

Enthält die Anzahl der an das aktuelle Skript übergebenen Argumente, wenn das Skript auf der Kommandozeile läuft.

Hinweis: Der Dateiname des Skripts ist immer das erste an das Skript übergebene Argument, damit ist der kleinstmögliche Wert von $argc 1.

Hinweis: Diese Variable ist nur verfügbar, wenn register_argc_argv eingeschaltet ist.

Beispiele

Beispiel #1 $argc-Beispiel

<?php
var_dump
($argc);
?>

Wenn das Beispiel so aufgerufen wird: php script.php arg1 arg2 arg3

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

int(4)



add a note add a note User Contributed Notes
$argc
karsten at typo3 dot org
18-Feb-2009 08:47
Note: when using CLI $argc (as well as $argv) are always available, regardless of register_argc_argv, as explained at http://docs.php.net/manual/en/features.commandline.php

$argv> <$http_response_header
Last updated: Fri, 30 Oct 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites