Introduction To PHP
Introduction To PHP
Introduction To PHP
GEEKSFORGEEKS
PHP | Introduction
The term PHP is an acronym for PHP: Hypertext Preprocessor. PHP is a server-side
scripting language designed specifically for web development. It is open-source which
means it is free to download and use. It is very simple to learn and use. The files have the
extension “.php”.
Rasmus Lerdorf inspired the first version of PHP and participated in the later versions. It is
an interpreted language and it does not require a compiler.
Syntax:
<?php
PHP code goes here
?>
Example:
HTML
<html>
<head>
<title>PHP Example</title>
</head>
<body>
</body>
</html>
Output:
Hello, World! This is PHP code
Why should we use PHP?
PHP can actually do anything related to server-side scripting or more popularly known as
the backend of a website. For example, PHP can receive data from forms, generate dynamic
page content, can work with databases, create sessions, send and receive cookies, send
emails, etc. There are also many hash functions available in PHP to encrypt users’ data
which makes PHP secure and reliable to be used as a server-side scripting language. So
these are some of PHP’s abilities that make it suitable to be used as a server-side scripting
language.
PHP can run on all major operating systems like Windows, Linux, Unix, Mac OS X, etc.
Almost all of the major servers available today like Apache supports PHP. PHP allows
using a wide range of databases. And the most important factor is that it is free to use and
download and anyone can download PHP from its official source: www.php.net.
Disadvantages of PHP: