|
Posted by NC on 12/06/07 03:21
On Dec 5, 1:18 am, Ojas <contacto...@gmail.com> wrote:
>
> if the request has been sent through command line, $argc &
> $arv will exists whether having any values or not but since
> we can access these values from $_SERVER (or $_ENV not sure
> about it) which itself is an array, not set $_SERVER['argc']
> is equivalent to null $_SERVER['argc'], accessing the
> $_SERVER['argc'] will result to null values in both cases,
> then how one can distinguish these cases?
There's no need to. If the script is running from the command line, a
call to php_sapi_name() will return 'cli'.
Cheers,
NC
Navigation:
[Reply to this message]
|