Lesson 25 of 3083%

(Progress persistence is disabled until Phase 9)

PHP
Beginner

Functions

Learn about Functions in PHP.

PHP is a powerful server-side language. In this lesson, we will cover Functions.

Real code examples

<?php
function writeMsg() {
  echo "Hello world!";
}

writeMsg(); // call the function
?>

Common mistakes

Make sure you include the <?php tag when writing PHP!

Try It Yourself

You can experiment with this in the Playground.

Lesson Progress

Take QuizBuild a PHP Project