My Blog

My WordPress Blog

My Blog

My WordPress Blog

03. Control Statements

Continue Statement

Like the break statement, continue is another “loop control statement” in PHP. Unlike the break statement, the continue statement skips the current iteration and continues execution at the condition evaluation and then the beginning of the next iteration. The continue statement can be used inside any type of looping constructs, i.e., for, foreach, while or do-while loops. Like break, the continue keyword is also normally used conditionally. The following flowchart explains how the continue statement works […]

Break Statement

The break statement along with the continue statement in PHP are known as “loop control statements”. Any type of loop (for, while or do-while) in PHP is designed to run for a certain number of iterations, as per the test condition used. The break statement inside the looping block takes the program flow outside the block, abandoning the rest of iterations that may be […]

For Loop

A program by default follows a sequential execution of statements. If the program flow is directed towards any of earlier statements in the program, it constitutes a loop. The for statement in PHP is a convenient tool to constitute a loop in a PHP script. In this chapter, we will discuss PHP’s for statement. Flowchart of “for” […]

If…Else Statement

The ability to implement conditional logic is the fundamental requirement of any programming language (PHP included). PHP has three keywords (also called as language constructs) – if, elseif and else – are used to take decision based on the different conditions. The if keyword is the basic construct for the conditional execution of code fragments. More often than not, the if keyword is […]

Decision Making

A computer program by default follows a simple input-process-output path sequentially. This sequential flow can be altered with the decision control statements offered by all the computer programming languages including PHP. Decision Making in a Computer Program Decision-making is the anticipation of conditions occurring during the execution of a program and specified actions taken according […]

Scroll to top