Although PHP is used to develop dynamic Web pages, but PHP can also do server-side, PHP-CLI (php-commond-line-interface) script can be added to the Linux crontab Timer service, at a set point in time to execute.
Because the maximum execution time of the PHP-CLI is unlimited (the maximum execution is unlimited for CLI scripts), the Web script can execute up to 30 seconds by default, and PHP-CLI scripts to maintain the system is appropriate.
Under window, in the PHP directory, there is an executable program, then, in the cmd mode,
Go to the installation directory of PHP
d:\xampp\php>php d:\www\p.php
Executes the output, the contents of the p.php.
On Ubuntu also wrote a
In 1.php:
1<?PHP2 $num=fgets(STDIN);3 $count= 0;4 for($i= 0;$i<strlen($num);$i++){5 $count+=$num[$i];6 }7 $i= 0;8 $a=Array();9 while($count! = 0){Ten $out=$count% 10; One $count/= 10; A $count=intval($count); - $CC= ""; - Switch($out){ the Case1:$CC= "Yi"; Break; - Case2:$CC= "ER"; Break; - Case3:$CC= "San"; Break; - Case4:$CC= "Si"; Break; + Case5:$CC= "WU"; Break; - Case6:$CC= "Liu"; Break; + Case7:$CC= "Qi"; Break; A Case8:$CC= "ba"; Break; at Case9:$CC= "JIU"; Break; - Case0:$CC= "Ling"; Break; - } - $a[] =$CC; - } - $a=Array_reverse($a); in for($i= 0;$i<Count($a)-1;$i++){ - Echo $a[$i].‘ ‘; to } + Echo $a[$i]." \ n "; -?>
PHP-CLI Introduction