What is PHP?
The PHP script is first implemented on the server, and then the HTML result is sent back to the browser. The PHP script can be located anywhere in the document. The PHP script begins with <?php and ends with ?>. A PHP file generally contains HTML tags and PHP scripting code. In the following code, the function “echo” is a built- in PHP function that is used to output “Welcome to my World!”
<!DOCTYPE html> <html> <body> <?php ECHO "Welcome to my World!<br>"; echo "Welcome to my World!<br>"; EcHo "Welcome to my World!<br>"; ?> </body> </html>
PHP is not case sensitive. So when using keywords (ex. If, else, while, echo, etc.), functions, classes, and user-defined functions they are not case-sensitive. In the code below, the three different echo statements are all equal and legal in PHP.
Code written in PHP must be included inside one of the following markup tags that are recognized by the PHP Parser.
<?php PHP code goes here ?> <? PHP code goes here ?> <script language = "php"> PHP code goes here </script>
Why use PHP?
PHP can be run across many different platform applications like Windows, Linux, Unix, Mac OS X and a number of other operating systems. PHP is compatible with almost all servers. It is open-source and free for all to use at https://php.net. This allows for a large and active international community that uses PHP. PHP was partially developed as an object-oriented language, so the code is reusable as possible. PHP was created to program web applications through built-in GET and POST functions, in addition to URL and HTML script functionality. PHP’s server side offers great versatility. PHP supports backend servers including Netscape, Apache, Microsoft IIS, iPlanet, Caudium, Xitami, and Tornado. PHP is also supported by 20 databases. PHP’s fast performance enables quick turnaround times with the database. Since PHP was initially developed for creating dynamic websites, PHP’s scripts are easily embedded into HTML files. This makes it easier for developers to convert static website code into dynamic websites. Websites that use PHP are Facebook, Wikipedia, Tumblr, Slack, MailChimp and Etsy.
W3Schools. (n.d.). Php introduction. Retrieved March 15, 2021, from https://www.w3schools.com/php/php_intro.asp
PHP - Introduction. (n.d.). Retrieved March 15, 2021, from https://www.tutorialspoint.com/php/php_introduction.htm
7 global websites that use PHP in 2021. (n.d.). Retrieved March 15, 2021, from https://trio.dev/blog/companies-using-php
Top comments (0)