NYCPHP Meetup

NYPHP.org

Any way to check for CLI?

Mark Armendariz nyphp at enobrev.com
Fri Apr 4 10:05:02 EST 2003


Do any of you by any chance know how to check if a script is called via
command line or from a browser?
 
I have a script that is called from either one, and I need to change the
output methods accordingly.  Looking at the phpinfo, I don't see any
variable that seems like a solid "this is from the command line".
 
Oh, and to slip a second one in here.  What is $_SERVER['PWD']?  I
noticed it shows the dir structure to the current file on my server,
which is fantastic.  Is that what it's supposed to do?  And what does
PWD stand for.
 
Muchos Thanks and have a great Friday!!!
 
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030404/f1679af6/attachment.html>


More information about the talk mailing list