You are here: Re: Script running under Command Prompt or Browser or some other application? « PHP Programming Language « IT news, forums, messages
Re: Script running under Command Prompt or Browser or some other application?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация