function

PHP has many built-in functions. For example, strtoupper(), this function is to convert string to uppercase, another example is abs(), which is to return a value to be absolute. 
But we can also define our own function using statement:

function name_of_function($argument1, $argument2) 
{
 //function code here
}

The name of the function follows the function statement and precedes a set of parentheses. If your function requires arguments, you must place comma-separated variable names within the parentheses. These variables will be filled by the values passed to your function. Even if your function doesn't require arguments, you must nevertheless supply the parentheses.
By the way, The naming rules for functions are similar to the naming rules for variables, "The Building Blocks of PHP." Names cannot include spaces, and they must begin with a letter or an underscore. As with variables, your function names should be meaningful as well as consistent in style. The capitalization of function names is one such stylistic touch you can add to your code; using mixed case in names, such as myFunction() or handleSomeDifficultTask(), makes your code much easier to read.
see the example below:

<?php
function bold($word){
print("<b>$word</b>");
}

function italic($word) {
print("<i>$word</i>");
}

function underline($word) {
print("<u>$word</u>");
}

bold("Good Morning...");echo("<br/>");
italic("Good Afternoon...");echo("<br/>");
underline("Good Evening...");echo("<br/>");
?>
save it as function.php and open from your browser, the result should be like;

Good Morning...
Good Afternoon...
Good Evening...

all the  functions above expect a string as a paramater, so we place the variable name $word between the parentheses when we declare the function. Whatever is passed to all functions will be stored in this $word variable. Within the body of the functions,we print the $word variable, appending a <b>...</b> element to "bold function", <i>...</i> to "italic function" and <u>...</u> to "underline function".

The continue statement

The continue statement ends the execution of th current iteration but doesn't end the loop as a whole. Instead, the next iteration begins immediately. Using the previous example as in the break statement, replacing the break statement with the continue statement, we can get rid of a divide-by-zero error without ending the loop completely. See the example below:

<?php
$i = -4;
for ($i ; $i <= 10; $i++ ) {
if ( $i == 0 )
continue;
$temp = 1000/$i;
print "1000 divided by $i is... $temp<br>";
}
?>

save it as continue.php and open it through your browser. The result should be:

1000 divided by -4 is... -250
1000 divided by -3 is... -333.33333333333
1000 divided by -2 is... -500
1000 divided by -1 is... -1000
1000 divided by 1 is... 1000
1000 divided by 2 is... 500
1000 divided by 3 is... 333.33333333333
1000 divided by 4 is... 250
1000 divided by 5 is... 200
1000 divided by 6 is... 166.66666666667
1000 divided by 7 is... 142.85714285714
1000 divided by 8 is... 125
1000 divided by 9 is... 111.11111111111
1000 divided by 10 is... 100

As the result says, we know that the iteration stop temporarily if $i equals to zero and then continue the loop until finish

break statement

The break statement, though, enables you to break out of a code block.
Usually we use this in switch..case block. But we can use in loops as well as in the example below:

<?php
$i = -4;
for ($i ; $i <= 10; $i++ ) {
if ( $i == 0 )
break;
$temp = 1000/$i;
print "1000 divided by $i is... $temp<br>";
}
?>

save it as break.php and open from your browser.
We use break statement if we want to get out of a code block for probably to get rid of logic error such as division by zero or anything else.

The result should be like this:

1000 divided by -4 is... -250
1000 divided by -3 is... -333.33333333333
1000 divided by -2 is... -500
1000 divided by -1 is... -1000

The loop stop when $i equals to 0 (zero) and the loop gets out of the loop block.

do...while statement

do...while statement is a little like while statement turned on its head. The essential difference between the two is that the code block is executed before condition test and not after it.

do {
// code to be executed
//increment or decrement
} while (expression of condition) ; // only if condition is true, the code block is repeated

Remember that do...while statement always ends with a semicolon.

This type of statement will be useful when we want the code block to be executed at least once, even if in while statement evaluates to false. The code block below is executed a minimum of one time:

<?php
$i = 1;
do {
echo "The number is: $i<br />";
$i++;
} while (($i > 10) && ($i < 20));
?>

The do...while statement tests whether the variable $i contains a value that is greater than 10 and less than 20. In line 2, we initialized $1 to 1, so this expression returns false. Nonetheless, the code block is executed at least one time before the condition is evaluated, so the statement will print a single line to the browser.

The number is: 1

If we change the value of $i in line 2 to something like 10 and then run the script, the loop will display
The number is: 10
The number is: 11
The number is: 12
The number is: 13
The number is: 14
The number is: 15
The number is: 16
The number is: 17
The number is: 18
The number is: 19