PHP Tutorial 28/02/25, 3:29 PM
Tutorials Exercises Certificates Services Search... Log in
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS ›C
PHP Tutorial
PHP HOME
PHP Intro
PHP Tutorial COLOR
PICKER
PHP Install
‹ Home Next ›
PHP Syntax
PHP Comments
PHP Variables
PHP Echo / Print
PHP Data Types
Learn PHP
PHP Strings PHP is a server scripting language,
PHP Numbers
PHP Casting
and a powerful tool for making
dynamic and interactive Web pages.
PHP Math
PHP Constants PHP is a widely-used, free, and
efficient alternative to competitors
PHP Magic Constants
such as Microsoft's ASP.
PHP Operators
PHP If...Else...Elseif
PHP Switch
Start learning PHP now »
PHP Loops
PHP Functions
PHP Arrays
PHP Superglobals
PHP RegEx Easy Learning with
PHP Forms "PHP Tryit"
PHP Form Handling
With our online "PHP Tryit" editor, you can
PHP Form Validation
edit the PHP code, and click on a button
PHP Form Required
to view the result.
PHP Form URL/E-mail
PHP Form Complete
Example Get your own PHP Server
https://www.w3schools.com/php/default.asp Page 1 of 6
PHP Tutorial 28/02/25, 3:29 PM
<!DOCTYPE html>
<html>
<body>
<?php
<?php
echo "My first PHP script!";
?>
?>
</body>
</html>
Try it Yourself »
Click on the "Try it Yourself" button
to see how it works.
PHP Exercises
Many chapters in this tutorial end with an
exercise where you can check your level
of knowledge.
?
Exercise
What does PHP stand for?
PHP: Hyperspeed Performance
PHP: Hyperformat Programming
PHP: Hypertext Preprocessor
PHP: Hyperlink Pages
https://www.w3schools.com/php/default.asp Page 2 of 6
PHP Tutorial 28/02/25, 3:29 PM
Submit Answer »
See all PHP Exercises
PHP Examples
Learn by examples! This tutorial
supplements all explanations with
clarifying examples.
See All PHP Examples
PHP Quiz Test
Learn by taking a quiz! This quiz will give
you a signal of how much you know, or
do not know, about PHP.
Start PHP Quiz!
My Learning
Track your progress with the free "My
Learning" program here at W3Schools.
Log in to your account, and start earning
points!
This is an optional feature. You can study
at W3Schools without using My Learning.
https://www.w3schools.com/php/default.asp Page 3 of 6
PHP Tutorial 28/02/25, 3:29 PM
PHP References
W3Schools' PHP reference contains
different categories of all PHP functions,
keywords and constants, along with
examples.
Array Calendar Date Directory
Error Exception
Filesystem
Filter
FTP JSON KeywordsLibxml
Mail Math Misc MySQLi
Network Output RegEx SimpleXML
Stream String Var XML
HandlingParser
Zip Timezones
‹ Home Next ›
Track
your
https://www.w3schools.com/php/default.asp Page 4 of 6
PHP Tutorial 28/02/25, 3:29 PM
progress Sign Up Log in
- it's
free!
PLUS SPACES
GET CERTIFIED FOR TEACHERS
FOR BUSINESS CONTACT US
Top Tutorials
HTML Tutorial
CSS Tutorial
JavaScript Tutorial
How To Tutorial
SQL Tutorial
Python Tutorial
W3.CSS Tutorial
Bootstrap Tutorial
PHP Tutorial
Java Tutorial
C++ Tutorial
jQuery Tutorial
Top References
HTML Reference
CSS Reference
JavaScript Reference
SQL Reference
https://www.w3schools.com/php/default.asp Page 5 of 6
PHP Tutorial 28/02/25, 3:29 PM
Python Reference
W3.CSS Reference
Bootstrap Reference
PHP Reference
HTML Colors
Java Reference
Angular Reference
jQuery Reference
Top Examples Get Certified
HTML Examples HTML Certificate
CSS Examples CSS Certificate
JavaScript Examples JavaScript Certificate
How To Examples Front End Certificate
SQL Examples SQL Certificate
Python Examples Python Certificate
W3.CSS Examples PHP Certificate
Bootstrap Examples jQuery Certificate
PHP Examples Java Certificate
Java Examples C++ Certificate
XML Examples C# Certificate
jQuery Examples XML Certificate
FORUM ABOUT ACADEMY
W3Schools is optimized for learning and training. Examples might be simplified to improve
reading and learning.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot
warrant full correctness
of all content. While using W3Schools, you agree to have read and accepted our terms of
use, cookie and privacy policy.
Copyright 1999-2025 by Refsnes Data. All Rights Reserved. W3Schools is Powered by
W3.CSS.
https://www.w3schools.com/php/default.asp Page 6 of 6