For beginners: What is PHP?

SkyStra
May 7, 2020

PHP is an open-source, actively developed server-side scripting and programming language that is mostly used for web development. The majority of the WordPress core is written using PHP as the scripting language, that’s why the WordPress community has so much PHP talk. 

How does it work?

Since PHP is a server-side language, whenever a visitor requests a web page that has PHP code, the web server uses a particular PHP module to process that code, ie. PHP pre-processor parses the code and generates an HTML output that shows in a visitor’s browser window. 

In the majority of the cases, PHP files have a .php extension ( WordPress PHP files have them ), so they are easily recognizable. 

Here’s a basic example of the PHP code:

<?php
  echo "Hello, World!";
?>

It’s important to remember that PHP preprocessor will only process  PHP code that’s inside opening and closing tags. The opening tag is <?php, and the closing tag is ?>.

In addition to the standalone PHP files, PHP can also be used inside HTML files if needed. An excellent example of this type of usage is pulling the necessary information from the database and using it in plain HTML output.

PHP versions

Since PHP language is being actively developed – new versions are released all the time. As new versions are released, old versions stop being supported after some time; for example – PHP 5, 7.0, and 7.1 all reached end of life. This means that they will no longer receive any support or security updates, it’s best to stop using them. 

Our PHP settings will always update to the newest released versions. We also recommend updating your website’s code to run on the newest PHP versions for both better security and performance.

Do I need to learn PHP to run a WordPress website?

Absolutely not. A WordPress user doesn’t have to learn the PHP language or even know what it is to be able to install, manage, and maintain a  WordPress built site. WordPress core, themes, and plugins are already written for you, and all you need to do is use them. However, if you want to develop themes, plugins, or change the default behavior of WordPress via actions, filters, and hooks – you would need to learn the basic PHP syntax along with some HTML and CSS.