PHP Base Loop statement printing 99 multiplication table

Source: Internet
Author: User

The 99 multiplication table for PHP printing mathematics uses two for loops, and for loops is one of the more commonly used in PHP process Control statements, and the structure of the flow control statements is broadly divided into three types: sequential structure, branching structure and cyclic structure. Cyclic structures are most commonly used with while loops, do......while loops, and for loops, which have their own characteristics. where the while is suitable for the conditional loop, for the number of cycles , the 99 multiplication table best reflects the characteristics of the FOR Loop statement:

 

In addition, go to is not available in pure object-oriented Java, and the Go To,goto operator in the C language and PHP can be used to jump to a specified location in the program. The target location can be tagged with the target name plus a colon. The Goto in PHP has a certain limit and can only jump in the same file and scope, meaning you can't jump out of a function or class method, or jump into another function. You can't jump into any loop or switch structure either. A common use is to jump out of a loop or switch, instead of a multi-layered break.

<?php
Goto A;
Echo ' Foo ';

A:
Echo ' Bar ';
?>

  The features of Go to support others, and others object to the inclusion of Goto in PHP for the following reasons:

Supporters: Code jump fast, convenient

Opponents: the large use of goto statements is a disaster, especially in the subsequent maintenance of the code, the GOTO statement makes the program structure chaotic (although it can execute correctly), but it is difficult to read. Because goto statements can jump flexibly, if not limited, it does break the structural design style. Second, a goto statement often brings errors or pitfalls, and it may skip the construction of certain objects (destroying object-oriented principles), initialization of variables, important calculations, and so on. But to be realistic, this kind of mistake is caused by the programmer himself, not Goto's fault

  

PHP Base Loop statement printing 99 multiplication table

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.