CLI

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
PeterBailey
Forum Newbie
Posts: 2
Joined: Wed Jul 11, 2007 5:57 am

CLI

Post by PeterBailey »

I've just installed PHP for command line programing on my PC and i'd like some examples and maybe some tutorials on how to do things, the one's i've found seem to be all the same basic fundamental things. So has anyone got or know of somewhere that has command line scripts written in PHP i could have a look at?

And one other thing, when i run a script, it runs through it but then closes the window at the end unless i run it from the command prompt. Any ideas on how to stop that?

Thanks, Peter
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Re: CLI

Post by feyd »

PeterBailey wrote:I've just installed PHP for command line programing on my PC and i'd like some examples and maybe some tutorials on how to do things, the one's i've found seem to be all the same basic fundamental things. So has anyone got or know of somewhere that has command line scripts written in PHP i could have a look at?
Command line scripts are exactly the same as normal scripts, with some minor alterations. Particularly the inputs. $_SERVER has the details.
PeterBailey wrote:And one other thing, when i run a script, it runs through it but then closes the window at the end unless i run it from the command prompt. Any ideas on how to stop that?
That would be a setting in your operating system. PHP has no control of that.
PeterBailey
Forum Newbie
Posts: 2
Joined: Wed Jul 11, 2007 5:57 am

Post by PeterBailey »

I know it doesn't, looked in the settings and couldn't find out how to disable it but i can live with it for now.

I know it's the same, i can do silly things like echo, loop, deal with user input etc but not anything proper. Just wanted to see what other people can do with it - i can only think of file manipulation and calculators.
Post Reply