Lesson 14 of 3047%

(Progress persistence is disabled until Phase 9)

PHP
Beginner

Assignment Operators

Learn about Assignment Operators in PHP.

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

Real code examples

<?php
$x = 20;  
$x += 100; // Same as $x = $x + 100
echo $x . "\n"; // 120

$txt = "Hello";
$txt .= " World!";
echo $txt; // Hello World!
?>

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

Practice This TopicTake QuizBuild a PHP Project

Ready to practise?

Apply what you learned with a hands-on challenge.

Practise This Topic