PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Table of Contents

PHP Variables

A PHP variable is simply enough a container to store a value in. Let's go ahead and create our first variable.

So to create a PHP variable, we will start it off with $, add the name of the variable, and then give it a value. Here's an example:

$name = 'DevDojo';

This variable's name is name, and the value we gave it is DevDojo.

After creating our first variable, we can echo it out.

<?php

$name = 'DevDojo';

echo $name;

?>

This will print out the value (DevDojo) that we gave the variable.