Entering and Exiting PHP Mode

Unlike PHPs predecessors, you embed your PHP code inside your HTML as opposed to the other way around. Before PHP, many websites had standard HTML pages for most of their content, linking to Perl CGI pages to do back-end processing when needed. With PHP, all your pages are capable of processing and containing HTML. This is a huge factor in PHPs popularity.

Each PHP file is processed by PHP that looks for code to execute. PHP considers all the text it finds to be HTML until it finds one of four things:

Image <?php

Image <?

<% ...

Get Ubuntu Unleashed 2014 Edition: Covering 13.10 and 14.04,Ninth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.