11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

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

CHAPTER 3 • <strong>PHP</strong> BASICSwww.it-ebooks.infowould no<strong>net</strong>heless be highly inefficient for the engine to consider every line as a potential <strong>PHP</strong>command. Therefore, the engine needs some means to immediately determine which areas of the pageare <strong>PHP</strong>-enabled. This is logically accomplished by delimiting the <strong>PHP</strong> code. There are four delimitationvariants.Default SyntaxThe default delimiter syntax opens with , like this:Welcome!Some static output hereIf you save this code as test.php and execute it from a <strong>PHP</strong>-enabled web server, you’ll see theoutput shown in Figure 3-1.Figure 3-1. Sample <strong>PHP</strong> outputShort-TagsFor less motivated typists, an even shorter delimiter syntax is available. Known as short-tags, this syntaxforgoes the php reference required in the default syntax. However, to use this feature, you need toenable <strong>PHP</strong>’s short_open_tag directive. An example follows:42

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

Saved successfully!

Ooh no, something went wrong!