Wednesday, February 22, 2012

PHP

August 9, 2010 by tutorials · Leave a Comment 

PHP (Hypertext Preprocessor) is the most popular scripting language for web development. It is free, open source and server-side (the code is executed on the server).It is an alternative of Microsoft’s Active Server Pages (ASP) technology that is used for creating dynamic web pages. It can be embedded into HTML. PHP is usually used in conjunction with a MySQL database and in combination with a Web server like Apache.

Being extremely robust and scalable, PHP can be used for the most demanding of applications, and delivers excellent performance even at high loads.

Requests for PHP scripts are received by the Web server, and are handled by the PHP interpreter. The results obtained after execution are returned to the Web server, which transfers them to the client browser. PHP script can perform calculations, process user input, interact with a database, read and write files etc.

Basic PHP syntax

A PHP scripting block always starts with <?php and ends with ?>. It can be placed anywhere in the document.

<?php

//PHP code

?>

A PHP file normally contains HTML tags, just like an HTML file, and some PHP scripting code.

Example:

html>
<body>

<?php
echo “Hello World”;
?>

</body>
</html>

Each code line in PHP must end with a semicolon.

There are two basic statements to output text with PHP: echo and print.

The file must have a .php extension. If the file has a .html extension, the PHP code will not be executed.

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!