Use of keywords such as Break|require|return

Source: Internet
Author: User
Tags contains continue end functions include php file relative require

 

The end of the cycle: break  out of the entire loop, the remaining loop body, do not need to be executed. continue:  jumps out of the current loop, ending only the current loop body, while the rest of the loop body continues to execute.   Our Process Control statements can be nested. There may be loops within the   loop inside the branch    branch within the loop   loop. When there is a loop inside the loop, we call it multiple loops! For example   Delete a multiplication table:   If you write a break or continue within a multiple loop, control the loop that contains the break or continue directly.   If we need to simultaneously   end   Multiple loops &nbsp, you should   add parameters after  break or continue to indicate the number of loops that jump out (end). The parameter is an integral type  1  represents a layer   default. 2  represents 2 floors. Analogy   Continue can also be used in the same way as above. There are also exceptions: when a   loop statement   inner set   branch (switch) occurs,   terminates if needed:   is swtich as the   loop because of PHP internal  . The file contains a php file containing another PHP file. Include Require   where   filename section   can be a relative address   can also be an absolute address for  . Relative Address: The file that needs to be loaded, relative to an address of the current file.   Absolute Address: On Windows   start with the   letter to reach the real address of a file. If Linux is under   with  /  start with     For example loading files:   Usually in a PHP project, the use of absolute address is relatively large.   above  include  and  require  functions exactly the same, so the use of methods and effects are no different. Because there is a different level of requirements for the target loading file: Causes a different error level if the target file is incorrect. Include   require   include_once require_once have once  loading that will be &nbsp before the load is executed, and the target script should be judged firstWhether it has been, loaded into the current script. If it is already loaded, it will not be loaded again. Different from the loading without once. The difference between   include_once  and  required_once: The difference is the same as  include  and  require: Return is used in functions Using return outside of a function is equivalent to stopping script execution.   But   when  return  writes to   loaded script, the behavior changes in the   if it is written to the   target file, then return means: Target file  36.php   Loading his file: We receive the return value of the  include;   We usually use this feature   the configuration file for the project: Profile:   Use configuration:       Job for ( $i =0 ; $i  <=10;  $i  ++)  {    switch ($i)  {     case 3:         echo  ' Swtich ';         break 2;//continue 2;          echo  $i; If the code is as above, if break is replaced by continue , try to explain why.

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.