July 17, 2014 study notes--php study of cyclic structure

Source: Internet
Author: User
Tags learn php linux mint

Today began to learn PHP, in order to learn PHP to buy a book, but the book is a tome, not good with no good study, I decided to split the book chapter to see, so it is also convenient to take the task can also be completed quickly.

Today on Linux Mint 17 installed the LNMP environment and brackets tools, to learn PHP, small example with vim to complete.


Record your own landscaping of the 99 multiplication table

The code is as follows:

<?php    for ($i =1; $i <=9; $i + +) {        for ($j =1, $j <=9; $j + +) {            if ($i >= $j) {                      echo  "$j  *  $i  = ". $j * $i;                    if (  $i * $j  >= 10 )  {                         echo  "&nbsp;&nbsp;";                     } else {                        echo  "&nbsp;&nbsp;&nbsp;&nbsp; ";                     }            }         }        echo  "<br>";     }?>

As follows:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/3E/D3/wKiom1PHzA2SgrQfAAFtzD9eEVU722.jpg "title=" Selection _ 003.png "alt=" Wkiom1phza2sgrqfaaftzd9eevu722.jpg "/>

Modify the display effect so that each column is on a column, looking neat and nice,

Related Article

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.