What is PHP

  • PHP stands for Hypertext preprocessor that is known as server-side scripting language .
  • PHP designed by Rasmus Lerdorf and developed by Zend Technologies in 1994 .
  • PHP is used for the website development but also use for general programming language .
  • PHP is used for dynamic website development.

PHP files have extension “.php”.

What is a PHP File

  • PHP files can contain text, HTML, CSS, JavaScript, and PHP code.
  • PHP code is executed on the server, and the result is returned to the browser as plain HTML.
  • PHP files have extension “.php”.

PHP Work Flow

How PHP Work

 

  • First, the web browser sends an HTTP request to the web server, e.g., index.php.
  • Second, the PHP preprocessor that locates on the web server processes PHP code to generate the HTML document.
  • Third, the web server sends the HTML document back to the web browser.

Why PHP

  • PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)
  • PHP is compatible with almost all servers used today (Apache, IIS, etc.)
  • PHP supports a wide range of databases
  • PHP is free. Download it from the official PHP resource: www.php.net
  • PHP is easy to learn and runs efficiently on the server side

PHP Syntax 

<?php
echo"Hello"; 
?>

echo – The echo() function is used for print(display) the statement .

<?php - PHP opening
?> - PHP closing
You must open and close PHP using <?php and ?> .

 

You can embed the HTML code in PHP.  

Features Of PHP
 

What are the advantages of PHP?

  1. Open source and free of cost
  2. A lot of tutorials & study material
  3. Flexibility & Customization
  4. Minimal Load time
  5. User-friendly
  6. Cloud Compatibility
  7. Compatibility with HTML
  8. It can run on various OS
  9. Powerful library support

What are the disadvantages of PHP?

  1. Security Concerns
  2. Lack of Good debugging tool
  3. Falling Popularity
  4. Lack of performance
  5. Not suitable for Big Content-Based Web apps
  6. Difficult to handle