Thursday, January 20, 2022
How can we help?
< All Topics

Difference Between $ and $$ in php

$name (single dollar) is a simple variable which is used to store string, integer, float etc..

$$name (double dollar) is a reference variable that store the variable with single dollar ($name) value inside it.

To understand this difference let’s take an example.

   $name = "Infojackers";
   $$name = "Checkout new blogs post.";
   echo $name."<br>";
   echo $$name."<br>";
   echo $infojackers;


// Infojackers
// Checkout new blogs post.
// Checkout new blogs post.
Next How to make first program in php- As a beginner
Table of Contents