|
Posted by Steve on 05/18/07 16:17
thanks...i did google and found that shortly after posting the question. i
was hoping to find that there was php function that defined the run-time env
a bit more elegantly though. however, it does solve the problem.
thanks again.
"Toby A Inkster" <usenet200703@tobyinkster.co.uk> wrote in message
news:2es0i4-8oj.ln1@ophelia.g5n.co.uk...
| Steve wrote:
|
| > 1) can parameters be given to a script being run through the cli on a
| > cron,
|
| Yes. Google: PHP argv argc
|
| > or 2) is there a method available to a php script that allows the
| > detection of whether it is a cli operation or http?
|
| <?php
| echo (isset($_SERVER['argv'][0]) ? 'Command line' : 'Apache');
| ?>
|
| --
| Toby A Inkster BSc (Hons) ARCS
| http://tobyinkster.co.uk/
| Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux
Navigation:
[Reply to this message]
|