Instructions on break and continue in PHP-PHP Tutorial

Source: Internet
Author: User
The process control commands break and continue in PHP are parsed. The break and continue process control commands in PHP are parsed into 0a0, b0b0, c0c0, d0d0, e0e0 ,); * ******** break ******** is used to jump out of the current execution cycle, and does not continue to execute the parsing of the break and continue control commands in PHP.
 '0a0 ',' B '=> '0b0', 'C' => '0c0', 'D' => '0d0 ', 'E' => '0e0 ',); // ******************* // this method jumps out of the current execution cycle and does not continue to execute the loop. Foreach ($ arr as $ k =>$ v) {if ($ k = 'C') {break;} $ arr2 [$ k] = $ v ;} var_dump ($ arr2);/* array (size = 2) 'a' => string '0a0 '(length = 3) 'B' => string '0b0' (length = 3) * // ******************* // immediately stop the current execution loop and return to the condition judgment of the loop, continue to the next loop. Foreach ($ arr as $ k =>$ v) {if ($ k = 'C') {// Ignore the processing of this item continue ;} $ arr3 [$ k] = $ v;} var_dump ($ arr3);/* array (size = 4) 'a' => string '0a0 '(length = 3) 'B' => string '0b0' (length = 3) 'D' => string '0d0' (length = 3) 'E' => string '0e0' (length = 3) */?>

Defaults 0a0, B => 0b0, c => 0c0, d => 0d0, e => 0e0 ,); // ******************* // this method jumps out of the current execution cycle and does not continue to execute the cycle...

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.