PHP 5 Tutorial

PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.

PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.

Easy Learning with "Show PHP"

Our "Show PHP" tool makes it easy to learn PHP, it shows both the PHP source code and the HTML output of the code.


<!DOCTYPE html>

echo "My first PHP script!";

Run example »

Click on the "Run example" button to see how it works.

Start learning PHP now!

PHP 5 vs. PHP 7

PHP 7 is the newest version of PHP.

PHP 7 is much faster than the previous popular stable release!

PHP 7 has improved Error Handling, supports stricter Type Declarations and supports new operators, methods and properties.

Go To PHP 7 »

PHP Exercises

Test Yourself With Exercises


Insert the missing part of the code below to output "Hello World".

 "Hello World";

PHP Examples

Learn by examples! This tutorial supplements all explanations with clarifying examples.

Go to PHP Examples!

PHP 5 References

At W3Schools you will find complete references of all PHP functions:

Array functions

Calendar functions

Date functions

Directory functions

Error functions

Filesystem functions

Filter functions

FTP functions

HTTP functions

LibXML functions

Mail functions

Math functions

Misc functions

MySQLi functions

SimpleXML functions

String functions

XML Parser functions

Zip functions

PHP 5 Quiz Test

Test your PHP skills at W3Schools!

Start PHP Quiz!

PHP 5 Exam - Get Your Diploma!

W3Schools Certification

W3Schools' Online Certification

The perfect solution for professionals who need to balance work, family, and career building.

More than 25 000 certificates already issued!

Get Your Certificate »

The HTML Certificate documents your knowledge of HTML.

The CSS Certificate documents your knowledge of advanced CSS.

The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.

The jQuery Certificate documents your knowledge of jQuery.

The PHP Certificate documents your knowledge of PHP and SQL (MySQL).

The XML Certificate documents your knowledge of XML, XML DOM and XSLT.

The Bootstrap Certificate documents your knowledge of the Bootstrap framework.