What is PHP?
PHP means Hypertext Preprocessor. It is an open source general - purpose
scripting language. It is widely-used for web development and embedded into HTML
(Hypertext Text Markup Language). PHP pages also contains HTML with embedded
code. PHP code has enclosed with some special tags like: start and end PHP
processing instructions.
PHP Processing Instructions:
- PHP start tag: <?php
- PHP end tag: ?>
Above php processing instructions allow you to jump out of the PHP mode.
Disadvantage:
- In PHP client-side JavaScript is executed on server and it generates HTML
code that is sent to the client.
- Client would receive the result of running JavaScript code.
Simple Example of PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 <br />
Strict//EN" "http://www.w3.org/TR/xhtml1/DTD<br />
/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Intorduction to PHP</title>
</head>
<body>
<? echo "Welcome to php." ?>
</body>
</html>
|
Output:
Download Example