Chapter 10 Introduction to Sequence Control Structures

10.1 What is the Sequence Control Structure?

Sequence control structure refers to the line-by-line execution by which statements are executed sequentially, in the same order in which they appear in the program/script, without skipping any of them. They might, for example, carry out a series of read or write operations, arithmetic operations, or assignments to variables.

The following script shows an example of PHP statements that are executed sequentially.

 file_10.1
<?php
//Prompt the user to enter value for $num
$num = (int)readline("Enter a number: ");
 
//Calculate the square of $num

Get PHP and Algorithmic Thinking for the Complete Beginner now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.