Site icon DED9

What is PHP? Every thing about it.

php programming

What is PHP programming?

PHP programming is a server side scripting language. that is used to develop Static websites or Dynamic websites or Web applications.  And PHP stands for Hypertext Pre-processor, that earlier stood for Personal Home Pages.

PHP scripts can only be interpreted on a server that has PHP installed.

Also The client computers accessing the PHP scripts require a web browser only.A PHP file contains PHP tags and ends with the extension “.php”.

In this Article you will Learn

What is a Scripting Language?

A script is a set of programming instructions that is interpreted at runtime.

A scripting language is a language that interprets scripts at runtime. Scripts are usually embed into other software environments.

So The purpose of the scripts is usually to enhance the performance or perform routine tasks for an application.

Server side scripts are interpreted on the server while client side scripts are interpreted by the client application.

PHP is a server side script that is interpreted on the server while JavaScript is an example of a client side script that is interpreted by the client browser. Both PHP and JavaScript can be embedded into HTML pages.

Programming Language Vs Scripting Language, Whats the Difference?

Programming language Scripting language
Has all the features needed to develop complete applications. Mostly used for routine tasks
The code has to be compiled before it can be executed The code is usually executed without compiling
Does not need to be embedded into other languages Is usually embedded into other software environments.

What does PHP stand for?

PHP means – Personal Home Page, but it now stands for the recursive backronym PHP: Hypertext Preprocessor.

And Also PHP code may be embedded into HTML code, or it can be used in combination with various web template systems, web content management system and web frameworks.

PHP Syntax

A PHP file can also contain tags such as HTML and client side scripts such as JavaScript.

Why use PHP?

You have obviously heard of a number of programming languages out there; you may be wondering why we would want to use PHP as our poison for the web programming. Below are some of the compelling reasons.

Who Uses PHP programming

A number of established companies and tech giants use PHP to run their servers and make a lot of incredible things.

What is PHP used for & Market share

In terms of market share, there are over 20 million websites and application on the internet developed using PHP scripting language.

PHP File Extensions

File extension and Tags In order for the server to identify our PHP files and scripts, So we must save the file with the “.php” extension. Older PHP file extensions include

PHP is design to work with HTML, and as such, it can be embeded into the HTML code.

You can create PHP files without any html tags and that is call Pure PHP file .

The server interprets the PHP code and outputs the results as HTML code to the web browsers.

In order for the server to identify the PHP code from the HTML code, we must always enclose the PHP code in PHP tags.

A PHP tag starts with the less than symbol followed by the question mark and then the words “php”.

PHP is a case sensitive language, “VAR” is not the same as “var”.

The PHP tags themselves are not case-sensitive, but it is strongly recommend  that we use lower case letter. The code below illustrates the above point.

<?php … ?>

We will be referring to the PHP lines of code as statements. PHP statements end with a semi colon (;). If you only have one statement, you can omit the semi colon. If you have more than one statement, then you must end each line with a semi colon. For the sake of consistency, So it is recommended that you always end your statement(s) with a semi colon. PHP scripts are executed on the server. The output is returned in form of HTML

PHP Hello world

The program shown below is a basic PHP application that outputs the words “Hello World!” When viewed in a web browser.

<?php
echo "Hello world";
?>

Output:

Hello world

Is PHP Dying?

Nowadays, there’s an intense debate on whether PHP is on the decline or not. This is because of the advent and increasing popularity of other languages suited for the server-side such as JavaScript (Node JS), Python, Golang, and others.

This has actually led to a lot of funny memes targeting PHP

But is PHP really dying? The answer is no. Despite some people bashing on it and the claims of decline, PHP is still used to run the servers of almost 80% of all websites today. So, if you visit 10 websites a day, there’s a chance that 8 of them use PHP.

In terms of job availability, PHP ranks better than a lot of other programming languages on the job platform Indeed. A lot of PHP developers make a good living making WordPress themes and plugins every year – the average PHP developer in the US makes $86,000 per year.

Conclusion

PHP remains a relevant and widely-used language in web development. Despite the mockery and debate on whether it’s still valuable, PHP developers keep earning good livings from working with the language. So, PHP doesn’t seem to be going anywhere anytime soon.

 

 

Exit mobile version