25.09.2014 Views

ZEND PHP 5 Certification STUDY GUIDE

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 1<br />

<strong>PHP</strong> Basics<br />

Every <strong>PHP</strong> application is forged from a small set of basic construction blocks.<br />

From its very inception, <strong>PHP</strong> was built with the intent of providing simplicity and<br />

choice—and this is clearly reflected in the number of options available in building<br />

applications. In this chapter, we will cover the essentials that you will use day in and<br />

day out.<br />

Syntax<br />

<strong>PHP</strong>’s syntax is derived from many languages—predominantly the C language, but<br />

Perl has also had a lot of influence on its syntax. With the latest object-oriented additions,<br />

more Java-like syntax is creeping in as well. Despite incorporating elements<br />

of so many other languages, <strong>PHP</strong>’s syntax remains simple and easy to understand.<br />

Source Files and <strong>PHP</strong> Tags<br />

Licensed to 482634 - Amber Barrow (itsadmin@deakin.edu.au)<br />

Even though it is often used as a pure language, <strong>PHP</strong> is primarily designed as a text<br />

processor (hence its name). To facilitate this role, <strong>PHP</strong> code can be inserted directly<br />

into a text file using a special set of tags; the interpreter will then output any text<br />

outside the tags as-is, and execute the code that is between the tags.<br />

There are four types of tags available:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!