Skip to Content
Core PHP Programming, Third Edition
book

Core PHP Programming, Third Edition

by Leon Atkinson
August 2003
Intermediate to advanced
1104 pages
19h 27m
English
Pearson
Content preview from Core PHP Programming, Third Edition

2.1. A Top-Down View

Every PHP script is a collection of one or more statements. Each statement instructs PHP to perform a subtask, which is part of the greater algorithm. The statement appears as a collection of names, numbers, and special symbols. At the end is either a semicolon or a block of statements inside curly braces. For clarity, you may add any number of line breaks and spaces within the statement. Any block of PHP code that does work and ends in a semicolon is a statement. Listing 2.1 shows several simple statements.

Listing 2.1. Simple statements
<?php
    //an expression statement
    2 + 3;

    //another expression statement
    print("PHP!");

    //a control statement
    if(3 > 2)
    {
        //an assignment statement
        $a = 3;
    }
?>

The first statement is the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming PHP, 3rd Edition

Programming PHP, 3rd Edition

Rasmus Lerdorf, Kevin Tatroe, Peter MacIntyre
Programming PHP

Programming PHP

Rasmus Lerdorf, Kevin Tatroe
Programming PHP, 2nd Edition

Programming PHP, 2nd Edition

Rasmus Lerdorf, Kevin Tatroe, Peter MacIntyre
Advanced PHP Programming

Advanced PHP Programming

George Schlossnagle

Publisher Resources

ISBN: 0130463469Purchase book