WeCodeAcademy

PHP Introduction

PHP is a language built for the web. It runs on the server: when you visit a page, PHP builds the HTML and sends it to your browser. WordPress, Wikipedia and a large part of the web run on PHP.

PHP code lives between <?php and ?> tags. echo prints text.

ExamplePHP
<?php
echo "Hello, World!";
Output
Hello, World!

These examples are shown as read-only code with their real output (run with php file.php on your own computer). In a web page, the output would be sent to the browser as HTML.

Quick check

Where does PHP code run?

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.