Introduction to PHP

      No Comments on Introduction to PHP

PHP (recursive acronym for : Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.

An introductory example
echo "My first php script";


My first php script

What is PHP?

  • It is a widely-used, open source scripting language
  • It scripts are executed on the server
  • It is free to download and use

Basic Syntax

A script can be placed anywhere in the document.A script starts with :

// PHP code goes here

Creating and declaring variables

In PHP, a variable starts with the $ sign, followed by the name of the variable:

$x=10; //variable
$txt="Hellow world";

More about PHP:

  • A PHP file can contain text,HTML,css,JavaScript. It runs over a server and returns the results to a browser in plain HTML.
  • It can generate dynamic page content and can create, open, read, write, delete, and close files on the server.It can collect form data.It can send and receive cookies
  • Can add, delete, modify data in your database. It can be used to control user-access
    and it can also encrypt data

Why PHP?

  1. Fast and easy to learn and use
  2. Can run on many platforms, including Windows, Linux and Mac, it’s easy for users to find hosting service providers.It is compatible with all servers like (Apache, IIS, etc.)
  3. It supports a wide range of databases
  4. Open source. Download it from the official  resource:
    PHP is free software released under the License, which stipulates that: Products derived from this software may not be called “PHP”, nor may it appear in their name, without prior written permission from restriction on use of it makes the¬† License incompatible with the General Public License (GPL), while the Zend License is incompatible due to an advertising clause similar to that of the original BSD license.

PHP Mascot

Leave a Reply

Your email address will not be published. Required fields are marked *