As we know that $ is used to declaring the variable in PHP, but most of the programmer uses $$ to pass the value of one variable into another. and we can say that $$ used when we want to use a dynamic variable name not a fixed variable name.
What Is The Difference Between $ And $$ in PHP?
Let take an example of $ and $$ to learn in detail
<?php $var = "Hello"; $$var = "World"; echo $var; echo "<br>"; echo $$var; echo "<br>"; echo $Hello;
Hello World World
$var = “Hello”;
$$var = “World”;
we can say that $Hello = “World” because we have delare $var=”Hello” and when we trying to echo $Hello then output will be World