Some time ago I decided it would be interesting to write an extremely simple PHP terminal chat to try out PHP's sockets and the socket_select() function usage. If you're not in to reading, feel free to skip to the samples and/or the sources ;)
What is a socket_select() (or *_select() for that matter) you ask?
Showing posts with label command line. Show all posts
Showing posts with label command line. Show all posts
Thursday, July 23, 2009
Saturday, February 7, 2009
Accessing command line from PHP code
It is sometimes necessary (or easier) to execute command line commands from within PHP code, in this post I will show an example of such usage. If you only need an über-basic example, here it is:
This little piece of code will copy the running script to newfile.php. If you're not satisfied yet, keep reading.
<?php
$thisf = $_SERVER['SCRIPT_NAME'];
`cp $thisf newname.php`;
?>
This little piece of code will copy the running script to newfile.php. If you're not satisfied yet, keep reading.
Subscribe to:
Posts (Atom)