What is php ?

| Last Updated: | In: PHP Tutorial


PHP stands for Hypertext Preprocessor and is a server-side language. This means that when a visitor opens the page, the server processes the PHP commands and then sends the results to the visitor’s browser, just as with ASP. A typical PHP files will content commands to be executed in the server in addition to the usual mixture of text and HTML (Hypertext Markup Language) tags. However, PHP is Open Source and cross-platform. PHP runs on Windows NT and many Unix versions, and it can be built as an Apache module and as a binary that can run as a CGI.

Common uses of PHP in web development

1) PHP is the server side scripting language, you can use this for creating static and dynamic website.
2) You can restrict your visitor to access some private web pages of your website.
3) You can use for encrypt and decrypt data.

Canonical PHP tags and Short-open (SGML-style) tags

If you are ready to start coding in php, then you can use the opening and closing tags in two manners. Following are the ways by which you can start and end the PHP tags :

1) ( PHP tags )
2) ( Short-open tags )

PHP Syntax

PHP’s language syntax is similar to C’s and Perl’s. You don’t have to declare variables before you use them.

Running PHP Script from Command Prompt

You can run PHP in two different ways first is using web browser like google chrome, Firefox, Internet explorer, Safari, and etc.. and second is using the command line. bellow is the examples that describe how to run PHP from command line.

Create hello.php page and add bellow code snippets and saved it.

Now run bellow command from command line as follows −

$ php hello.php

You will get the output as :

My first PHP script!

Tags: , ,

About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.

You may also like:

Get Free Access of 450+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Free Guide: Learn how to implement security guideline in your WordPress site...


Free WordPress Setup Service

Free WordPress Setup

Want to Setup WordPress Blog Setup? I will help you in the setup of your WordPress blog.

Click Here

Pincode Finder

pincode-finder tool

Online Pincode Finder

Best tool to locate post Office address and pincodes of all india...