20120423

Embedding PHP into the HTML

PHP can write with HTML combination. We can integrate PHP within HTML.

When a user requests this page, the web server preprocesses it, the page process from top to bottom, looking for sections of PHP, the php code will try to resolve, and finally the page provides the result as HTML format.

HTML and PHP Example:



When a user requests this page, the web server preprocesses it, the page process from top to bottom, looking for sections of PHP, the php code will try to resolve, and finally the page provides the result as HTML format.

Here is the "Browser" HTML Code::


This code is exactly the same as if you were to write the HTML by hand!

The HTML-embeddedness of PHP has many helpful to add dynamical code.

  • PHP can quickly be added to code produced by WYSIWYG editors.
  • Every line of HTML does not need to be rewritten in a programming language.
  • PHP can reduce man power costs and increase efficiency, because of its easy learning curve and ease of use.

No comments: