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

PHP Assign Multiple Variables in One Line

<?php 

$var1 = $var2 = $var3 = '';

?>

When you need to assign or declare mutliple variables at once, this can be accomplished with one line. So instead of making your code look cluttered like so:

$var1 = '';
$var2 = '';
$var3 = '';

To perform the exact same functionality in one line, you can write it like so:

$var1 = $var2 = $var3 = '';

Easy peasy, right? Hope that helps :)

BETA Snippet explanation automatically generated by OpenAI:

No explanation generated yet.

Snippet By Dev Dojo

ยท

Created June 12th, 2021

ยท

Report Snippet