What are the php jump statements?

coldplay.xixi
Release: 2023-03-05 12:10:01
Original
5661 people have browsed it

php jump statements include: 1. The break statement can not only jump out of the current loop, but also specify how many loops to jump out of, with a format such as [break n;]; 2. After executing the continue statement, the program will end execution of this cycle and start the execution of the next cycle.

What are the php jump statements?

Related learning recommendations:php graphic tutorial

PHP programming language has two jump statements, namely break and continue

1.breakJump statement

The break keyword can terminate The current loop includes all control statements including while, do...while, for, foreach and switch.

The break statement can not only jump out of the current loop, but also specify how many loops to jump out of. The format is as follows:

break n;

2.contunueJump statement

After the program executes break, it will jump out of the loop and start executing the remainder of the loop body The statement .continue jump statement is not as powerful as break. It can only terminate the current cycle and enter the next cycle. After executing the continue statement, the program will end the execution of the current cycle and start the next cycle. The execution operation of the loop. continue can also specify how many loops to jump out of.

The break and continue statements both implement jump functions, but there is still a difference: the continue statement only ends the current loop, not the entire The execution of the loop, and the break statement is the entire loop process.

Related learning recommendations:php programming(video)

The above is the detailed content of What are the php jump statements?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!