PHP Tutorial

A web server programming language.

PHP Syntax

PHP Syntax

A PHP script is executed on the server, and the plain HTML result is sent back to the browser.

A PHP script starts with <?php and ends with ?>.

Example:

<?php
// PHP code goes here
echo "Hello World!";
?>

Case Sensitivity: In PHP, keywords (e.g. if, else, while, echo, etc.), classes, functions, and user-defined functions are NOT case-sensitive. However, all variable names are case-sensitive!

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics