PHP-CLI Introduction

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.