25.09.2014 Views

ZEND PHP 5 Certification STUDY GUIDE

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4 ” <strong>PHP</strong> Basics<br />

Standard Tags<br />

Short Tags <br />

... code<br />

?><br />

<br />

<br />

... code<br />

<br />

... code<br />

%><br />

Standard tags are the de-facto opening and closing tags; they are the best solution for<br />

portability and backwards compatibility, because they are guaranteed to be available<br />

and cannot be disabled by changing <strong>PHP</strong>’s configuration file.<br />

Short tags were, for a time, the standard in the <strong>PHP</strong> world; however, they do have<br />

the major drawback of conflicting with XML headers and, therefore, have somewhat<br />

fallen by the wayside. Their other advantage is the availability of the short form<br />

syntax, which allows you to print the result of an expression directly<br />

to the script’s output.<br />

Script tags were introduced so that HTML editors which were able to ignore<br />

JavaScript but were unable to cope with the standard <strong>PHP</strong> tags could also ignore<br />

the <strong>PHP</strong> code. Nobody quite understands why ASP tags were introduced—however,<br />

if you are so inclined you can turn on this optional configuration option, and you are<br />

free to use them.<br />

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

i<br />

Short tags, script tags and ASP tags are all considered deprecated and their use is<br />

strongly discouraged.

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

Saved successfully!

Ooh no, something went wrong!