PHP

PHP is an abbreviated word for PHP: Hypertext Preprocessor. It is a widely-used open source general-purpose scripting language. PHP is a Server-side scripting language and mainly best for web development. It cab be embedded into HTML.

 

 

What can PHP do?

Generaly PHP is focused on server-side scripting for web application and acomplish task such as:

  • Collect form Data

  • Generate dynamic page content

  • create, open, read, write, delete, and close files on the server

  • send and receive cookies

  • data add, delete and modify in database of application

  • data encryption, etc. many more.

 

These there are three main areas where php scripts are used.

  • Server-side Scripting – PHP is widely used for web development application as server-side scripting to do above listed tasks and more. In this three things needed to make it work,

    • the PHP parser (wich translate or compile the PHP code like CGI or Server module)

    • a web server (like apache, ningix, etc),

    • A web browser (IE, Mozilla, Chrome, Safar, etc)

The PHP parser parse the PHP program and provide output and web server make that PHP program output viewable to a web browser.

  • Command line Scripting – PHP Command line scripting does not require any server or browser. Only PHP parser is required to use it this way. This type of usage is best for scripts regularly executed using cron (Cron Jobs on *nix or linux) or Task Scheduler (on windows).

  • Desktop Application Writing – In general PHP is not ideal language to create a desktop application with GUI (Graphical User Interface). Those who know PHP very well, and wand to use some advanced PHP features in client-sie application can also use PHP-GTK to write such programs. It is also useful to write cross-platform application. PHP-GTK is an extension to PHP which is not available with main distribution.

PHP runs on many platforms like windows, Linux, Unix, Mac OS X, etc. PHP works with almost all servers like Apache, ningix, IIS, etc. It supports most of databases. Its easy learn and runs efficiently on the server sides. It is free to download and use.

 

PHP File?

PHP file can contain, text, HTML, CSS, JavaScript and PHP code. PHP code are excuted on the server and output in the HTML to the browser.

PHP file extension have “.php”.

 

To Learn PHP You should already know the basics of following:

  • HTML

  • CSS

  • JavaScript

 

PHP Syntax:

<pre> <?php

echo "Hi, I'm a PHP script!";

?>

</pre>

Here "<pre> </pre>" tag is not the part of PHP code, only highlited text are the php sytax code.

You Must Learn More