News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

JavaWorld:
Web-less PHP Command Line PHP
May 31, 2011 @ 13:09:05

On JavaWorld they've posted a look at command-line PHP support including a few sample scripts to get you started:

When I decided to give PHP a closer look, I wondered if PHP was a browser-only technology or if it could be used for command line scripting. It turns out that one can write operating system level scripts with PHP as discussed in online resources such as Command Line Scripting in PHP, Command Line PHP on Microsoft Windows, and Executing PHP files. In this blog post, I look at PHP command line scripting at an introductory level.

He talks about some of the basics - setting up a "Hello World" script to be run as PHP (and running it) as well as adding in the ability to take command-line arguments. He shows how to get environment information and run other command calls through the PHP script. He also points out the handy php_sapi_name method that can be used to detect whether or not the script is running on the command line.

0 comments voice your opinion now!
commandline tutorial introduction windows


blog comments powered by Disqus

Similar Posts

Stefan Mischook's Blog: PHP Video: the Zend Framework and Web 2.0

PHP-Coding-Practices.com: How I Turned A Slow Array Sort Into A Quick One Using Quicksort Algorithm

Jani Hartikainen's Blog: Zend_Acl part 2: different roles and resources, more on access

CorePHP Blog: A Guide to running Apache 2, PHP 4 & PHP 5 on Windows XP

Andreas Gohr's Blog: Understanding PHP code better with Xdebug


Community Events





Don't see your event here?
Let us know!


release application install podcast api wordpress language framework interview developer unittest series library community symfony code threedevsandamaybe list introduction configure

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework