Archive for Beginner

Processing PHP output statements

The Hello World script, like most PHP scripts for the Web, is written mainly
to output HTML code that the browser then processes and displays in your
Web page. When writing PHP code to deliver output to a Web browser, you
need to keep in mind that there are two stages, as follows: Read the rest of this entry »

Leave a Comment

Writing Your First PHP Script

It’s sort of a tradition that the first program you write in any language is the
Hello World program. You may have written a Hello World program in
HTML when you first learned it. If you did, it probably looked similar to the
following HTML file: Read the rest of this entry »

Leave a Comment

Building Scripts

To build a script, you add PHP statements one after another to a file that you
name with a .php extension. Actually, if you are wise, you write the script
on paper first, unless the script is very simple or you are quite experienced.
Planning makes programming much less prone to errors. Read the rest of this entry »

Leave a Comment

Writing PHP Statements

A PHP statement tells PHP to perform an action. One of the most common
PHP statements is the echo statement. Its purpose is to display output. For
instance, take a look at the following echo statement: Read the rest of this entry »

Leave a Comment

Documenting the PHP Script

Adding comments to your script is essential. Comments describe your
script — what it does and how it does it. The larger, more complicated, or
more unusual your code is, the more you need comments. After working
20 hours a day on a script, you may believe its code is permanently burned
into your brain. From experience, however, I know that two years from now,
when you need to revise this script, you will swear it was written by a stranger.
And there’s also the possibility that your scripts may need to be revised by
an actual stranger. You may be long gone, retired in luxury in the Bahamas,
when your scripts need to be revised. Read the rest of this entry »

Leave a Comment

Follow

Get every new post delivered to your Inbox.