What are the different types of statements that are present in PHP?

There are four kinds of PHP statements that are present. They are as follows:
• Simple statement- these are the echo statements and end with a semicolon (;). PHP ignores white spaces between simple statements. Until it finds a semicolon it reads the statement.
• Complex/Conditional statements: these are the statements which deal with certain conditions that have to be executed to meet certain specific requirements. These are if and else block or switch statements. PHP reads the complete statement and doesn’t stop at the first semicolon it encounters. It looks for starting and ending braces to end the execution.
• Looping statements: statements that are repeated in a block. The feature that enables you to execute the statements repeatedly is called as loop. For example: for loop, while loop, do..while loop.

Leave a Reply

Your email address will not be published. Required fields are marked *