Tim Buchalka

PHP is your friendly server-side scripting language. But what on earth does that mean — what is PHP? In this article, we’ll introduce you to the different languages of the web, how they fit into the flow of information between clients (your computer or mobile device) and servers (the physical machine that ‘serves’ up the website data), and how PHP is a heavy lifter behind the scenes.

The building blocks of the web

If you are new to web development, then getting down the basics of HTML, CSS, and JavaScript is the right move before you enter the world of PHP. These are the basics of client-side (or browser-based) elements of the web.

PHP for Beginners

Last Updated December 2022

  • 203 lectures
  • Beginner Level
4.6 (2,891)

Build a Content Management System from Scratch with PHP and MySQL | By Tim Buchalka’s Learn Programming Academy, Dave Hollingworth

Explore Course

How does PHP work?

PHP, which stands for PHP: Hypertext Preprocessor, is a server-side (aka back-end) scripting language based originally on C.

Within internet operations, a client machine, generally through a browser, will make a request to a server somewhere else in the world to view an HTML and/or PHP document.

PHP is code designed to execute on the server, rather than delivering to the browser to execute, which is known as browser-side execution.

Within this machine setup, you have a web server, generally an Apache server that supports all operating systems, such as Windows, Mac, Unix, etc. The Apache server grabs the file requested from the client (through the browser, on the other side of the world), and if there is PHP code within the file, executes it (usually through operations on a database such as MySQL or MariaDB), then returns the result to the client.

This means you can create dynamic or static page content; do file operations such as reading, writing to, and deleting on the server; capture form content from pages and store it either in files or on a database — it can even be used for encryption!

Because PHP is executed on the server, it outputs HTML to return to the browser.

What is PHP? Facts and figures to know

Now that we know high-level how PHP works, let’s break down some helpful facts and figures:

Original release date: June 1995

Original creator: Rasmus Lerdorf

Mascot: elePHPant

Current version: PHP7.4 (released November 28, 2019)

Most popular PHP editor: PHPStorm or Visual Studio Code for a multi-purpose editor

Most popular PHP frameworks: Laravel and Symfony

File extension: .php

Current number of websites running PHP: Usage statistics from W3 Techs show that 78.8% of all known websites use PHP.

Why do developers use PHP?

As we dive further into everything you need to know about PHP, let’s take a look at what makes it such a useful tool for developers. 

It’s open-source

Like many programming languages these days, PHP is open-source, which means that it is free for developers to use and modify. Because it’s also a very mature language (at over 15 years old), with ongoing community updates, that also means it’s very stable.

It’s everywhere

Take a look in the back-end (again, that means the server side!) of any website or web app and you’re likely to find PHP code. PHP is cross-platform and goes anywhere including across all hosting environments, plus it’s simple to install and configure. The popularity of PHP means that many legacy websites run with PHP and are still built with it. Even better, there’s a wealth of knowledge online about PHP development.

It’s built for the web

Unlike other languages, PHP was designed specifically for the web. While it can be used as a general-purpose scripting language, that’s not its key purpose. In fact, its creator originally developed it so he could perform cool actions with forms and use a database for his personal home pages. There are languages that perform similar functions, such as Ruby; but if you want precision for the web, PHP is the better choice.

Web hosting servers already support PHP

Rather than configuring web hosting servers for a particular language, almost all host servers come ready to run PHP.

What else can PHP do?

PHP can be used in command-line scripting or in client-side operations. Due to its high portability, PHP can be inserted as a PHP script into software projects of different languages. PHP isn’t just for dynamic server-side programming, even though this is its most common use case.

How do I write a PHP file?

To write a PHP file, start with a PHP editor like PHPStorm or Visual Studio Code You may also use a general text editor, such as Notepad, although code editors are far superior. Why? Code editors use a PHP linter, a tool that helps to find errors and bugs in your code. This error checking mechanism is great for beginners so that you don’t get frustrated trying to spot where you went wrong in your code.

What are the data types in PHP?

PHP supports 8 data types, which are used to construct variables. These data types include: 

What are PHP tags?

PHP tags are the notations that inform a document that the code within the tags is PHP and should be interpreted as such. PHP uses the start tag <?php and the end tag ?>. This means that PHP can be embedded in all sorts of different documents, although, most commonly, it’s embedded into a PHP file or an HTML document. This is similar to HTML start tags <html> and </html>.

How do I create PHP Hello World?

If you are creating a .php file, then you use the tags learned above to write:


echo ‘Hello, World!’; 


This will output the string Hello World!

Is PHP easy to learn?

Yes! Compared to other languages used for server-side scripting, such as ASP.NET, PHP is relatively easy to learn.

Which is the best database to use with PHP?

PHP comes with native support for MySQL, however, you can use it with other databases too, like Postgres, SQL Server, and Oracle Database.

Do you need to know PHP to do WordPress development?

PHP is an integral part of developing custom themes and plugins for WordPress sites. So, while you can create basic WordPress sites without knowing PHP, if you want to truly do WordPress development, then knowing PHP programming is essential.

How can you learn PHP development?

There are plenty of resources online that you can use to learn PHP. Everyone has a slightly different learning style and preference of materials, so don’t be discouraged if you try one course and you find it just not the right fit for you — try again and you might find something that will better suit your learning style.

Here are some courses to explore:

Page Last Updated: April 2020

Top courses in Development

Learn To Program with Delphi and Object Pascal
Huw Collingbourne
4.4 (749)
Complete C# Unity Game Developer 2D
GameDev.tv Team, Rick Davidson, Gary Pettie
4.7 (97,646)
Learn and Understand AngularJS
Anthony Alicea
4.5 (21,354)
Backbone Tutorial: Learn Backbonejs from Scratch
Mosh Hamedani
4.6 (1,878)
1 Hour HTML
John Bura
4.5 (3,701)
Statistics / Data Analysis in SPSS: Inferential Statistics
Quantitative Specialists
4.5 (1,361)
The Ultimate Excel Programmer Course
Daniel Strong
4.7 (16,061)

More Development Courses

Popular topics

Empower your team. Lead the industry.

Get a subscription to a library of online courses and digital learning tools for your organization with Udemy Business.

Request a demo

Courses by Tim Buchalka

Java Programming Masterclass updated to Java 17
Tim Buchalka, Tim Buchalka's Learn Programming Academy
4.5 (176,672)
Android Java Masterclass - Become an App Developer
Tim Buchalka, Jean-Paul Roberts, Tim Buchalka's Learn Programming Academy
4.3 (10,348)
Learn Python Programming Masterclass
Tim Buchalka, Jean-Paul Roberts, Tim Buchalka's Learn Programming Academy
4.6 (96,755)
Android App Development Masterclass using Kotlin
Tim Buchalka, Jean-Paul Roberts, Tim Buchalka's Learn Programming Academy, David Reidy
4.3 (5,771)
Java Spring Tutorial Masterclass - Learn Spring Framework 5
Tim Buchalka, Tim Buchalka's Learn Programming Academy, Goran Lochert
4.3 (6,160)
Learn C# for Beginners Crash Course
Tim Buchalka, Jean-Paul Roberts, Tim Buchalka's Learn Programming Academy
4.7 (1,733)
Learn Java Programming Crash Course
Tim Buchalka, Goran Lochert, Tim Buchalka's Learn Programming Academy
4.6 (3,494)
Data Structures and Algorithms: Deep Dive Using Java
Tim Buchalka, Goran Lochert, Tim Buchalka's Learn Programming Academy
4.5 (13,917)
Kotlin for Java Developers
Tim Buchalka, Goran Lochert, Tim Buchalka's Learn Programming Academy
4.5 (3,913)
Java SE 11 Developer 1Z0-819 OCP Course - Part 1
Tim Buchalka, Tim Buchalka's Learn Programming Academy
4.5 (3,233)
Java SE 11 Developer 1Z0-819 OCP Course - Part 2
Tim Buchalka, Tim Buchalka's Learn Programming Academy
4.5 (854)
Introduction to Continuous Integration & Continuous Delivery
Tim Buchalka, Tim Buchalka's Learn Programming Academy, Eduardo Rosas
4.5 (3,963)

Courses by Tim Buchalka