Hyper text preprocessor (PHP) is a server side scripting language. Like others scripting languages this HTML embedded scripting language creates dynamic web pages.
One of highly useful language for web programmers to develop dynamically generated web pages fast, the language draws most of its syntax from Perl, Java and C with some unique features of its own
Basic PHP syntax is:
PHP is a very simple language and easy to learn. The syntax is mostly similar to C except for dealing with the types of variables. You just have to work with values of the variables no need to bother about the types or declaration at all.
PHP Syntax:
- The PHP file extension is .php.
- Comments: The commenting style is similar to C.
// This is one comment.
//* This is a multi- line comment*/
- A PHP code block starts with “<?php” and ends with “?>”. Being HTML embedded a PHP code block can be positioned anywhere in the HTML document
- Every code line in PHP end with a semicolon. To separate one set of instruction from another a semicolon is used.
- There are two statement output texts in PHP: print and echo.
An simple PHP illustration:
<html>
<head><title>Example</title></head>
<body>
<h1><?php echo “Saluton Mondo”; ?></h1>
<?php
$txt = “This is a PHP script”;
echo $txt;
?>
</body>
</html>
Some advantages of PHP over other server side scripting language are:
- It is open source, which means it freely available to be downloaded and used.
- This language runs on all the major operating systems like Windows, Linux, Unix
- PHP supports a host of databases like Oracle, Sybase, Postgre SQL, Informix, My SQL and ODBC.
- PHP is compatible with all the servers used today like IIS, Apache.
- Within an HTML page PHP code is embedded within specific PHP tags so when a visitor requests an output, the server processes the PHP code and send the output without sending the PHP script unlike sending Java Script.
- PHP along with MySQL can be used to serve on a Unix platform.
- PHP provides additional functionalities of Internet connecting to remote servers, email checking with POP3 or IMAP, redirecting, URL encoding and enabling cookies.
- When combined with Apache module, PHP becomes very fast. It returns result without any process creation overhead. It also keeps your servers memory image small as it doesnt need nay tuning of mod perl.
- You do not need any special editor to create pages in PHP as its embedded in HTML. However a PHP supporting server indeed is required.
Related posts:
- UPDATE: Facebook Rewrites PHP Runtime With HipHop Last time some websites reported that Facebook was planning to...
- Scripty 2 With the advent of information age, several efforts to streamline...
- Latest Version of Google Chrome Adds Auto-Translation and New Privacy Features Google just launched a new stable version of Google Chrome,...
Related posts brought to you by Yet Another Related Posts Plugin.

