Difference between Dollar and Double Dollar in PHP

Today we check the difference between single dollar ($) and double dollar ($$).

Here is a most confusing question that, what is the Difference between dollar and double dollar in PHPWe all know that in PHP programming $ is used for declaring variables or when we write a variable name in PHP, use $ before that name.

Difference between Dollar and Double Dollar in PHP

First thing, in the single dollar ($) stored data is fixed while in the double dollar ($$) is changed dynamically. Variable means are changeable. With explanation variables are those things which are changeable on time.

$var: represnts a variable

$$var (variable’s variable): represents a varibale with the content of $var

Now we check the major difference between $ and $$ with the help of an example below,

Example Difference between Dollar and Double Dollar in PHP

Use our PHP ONLINE EDITOR

Output: PHCODERTECH

Difference between $ and $$ in PHP

Explanation of the single dollar ($) and double dollar ($$) Example

$$var2 => $($var2) => $var => PHPCODERTECH

The double dollar is a very useful feature of PHP where you can use for assign variable value dynamically.

Check Also:

Create Dynamically Generated Text File and Download Using JavaScript

Happy Coding..!

Was this article helpful?
YesNo
My name is Bikash Kr. Panda. I own and operate PHPCODER.TECH, my native place in Odisha. I am a Web Programmer by profession and working on more than 50 projects to date. My passion is working on the web-based project using PHP and relate to all CMS and frameworks which is based on PHP.
Posts created 165

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top
mariobet - supertotobet - escort -

takip7.com

We are now accepting Guest Posting and creation of Backlinks
This is default text for notification bar