![]() |
php command line scripts
I just discovered that php can be used to write shell scripts. Anyone ever try this?
php command line |
Most web developers use this as well as the DB connecting functions to create dynamic contect generation.
|
This is a rather excellent feature of PHP, and it really makes sense when:
- You have an existing body of code that you are running within your webserver, and you want to leverage that when writing maintenance scripts, e.g. cron jobs. - You're an experienced PHP developer, but are not familar enough with the UNIX shell, or other scripting options languages like Perl and Python. |
How does this work? I heard about it but i have no idea how that goes.
|
Quote:
|
It is good to test quickly some php code...
Code:
php -r 'echo str_replace("borks", "rocks", "php in command line borks")."\n";' |
| All times are GMT -5. The time now is 12:59 PM. |