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?
- Open source and free of cost
- A lot of tutorials & study material
- Flexibility & Customization
- Minimal Load time
- User-friendly
- Cloud Compatibility
- Compatibility with HTML
- It can run on various OS
- Powerful library support
What are the disadvantages of PHP?
- Security Concerns
- Lack of Good debugging tool
- Falling Popularity
- Lack of performance
- Not suitable for Big Content-Based Web apps
- Difficult to handle