Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

control structures.continue function syntax tag tutorial 2013





Alert! Connect with 10,000 Chating Online. Join Now

Php control structures.continue () function

Write your php code

 
<?php ?>

Php Result


Your code below



continue

continue is used within looping structures to skip the rest of the current loop iteration and continue execution at the beginning of the next iteration.

Note: Note that in PHP the switch statement is considered a looping structure for the purposes of continue.

continue accepts an optional numeric argument which tells it how many levels of enclosing loops it should skip to the end of.

<?php
while (list($key, $value) = each($arr)) {
    if (!(
$key % 2)) { // skip odd members
        
continue;
    }
    
do_something_odd($value);
}

$i = 0;
while (
$i++ < 5) {
    echo
"Outer<br />\n";
    while (
1) {
        echo
"&nbsp;&nbsp;Middle<br />\n";
        while (
1) {
            echo
"&nbsp;&nbsp;Inner<br />\n";
            continue
3;
        }
        echo
"This never gets output.<br />\n";
    }
    echo
"Neither does this.<br />\n";
}
?>

Omitting the semicolon after continue can lead to confusion. Here's an example of what you shouldn't do.

<?php
  
for ($i = 0; $i < 5; ++$i) {
      if (
$i == 2)
          continue
      print
"$i\n";
  }
?>

One can expect the result to be :

0
1
3
4

but this script will output :

2

because the return value of the print() call is int(1), and it will look like the optional numeric argument mentioned above.

Php control structures.continue Function syntax tag

control structures.continue php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php control structures.continue syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online