You can run your code in a for loop, but some times you need to run a PHP script a daemon.
The most advantage of this is to running the process in the background, also if an error occurred the script will be automatically restarted.
Below is a PHP code , that can run another PHP script a a daemon.
#!/usr/bin/php
/**
* Handling SIG handlers
*/
$sigterm = false;
$sighup = false;
/**
* SIG handler
*/
function sig_handler($signo) {
global $sigterm, $si...
Introduction Regular expressions is a way to describing a pattern in piece of text, PHP supports two styles of regular expressions syntax : POSIX and Perl, The Posix style of regular expression is compiled ito PHP by default , but you can use the Perl style by compiling in Perl-compatable regular expression (PCRE) libraray. If you used the php matching functions you will note that all pattern matching you have done used String functions, and you have been limited to exact matches, So if you ...