Lesson 7 of 3023%

(Progress persistence is disabled until Phase 9)

PHP
Beginner

Strings

Learn about Strings in PHP.

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

Real code examples

<?php
$str1 = 'Single quotes print variable names: $name';
$str2 = "Double quotes interpolate variables: $name";

// String concatenation uses a dot .
$fullName = "John" . " " . "Doe";
echo "Length: " . strlen($fullName);
?>

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