Author Topic: What is the diffrence between $var and $$var  (Read 12433 times)

Rahul Kaushik

  • Newbie
  • *
  • Posts: 18
What is the diffrence between $var and $$var
« on: April 17, 2012, 02:17:16 PM »
Hi,
     Some one make me clear that what is  difference between $var and $$var.


     Thanks in advance

phpdeveloper

  • Newbie
  • *
  • Posts: 39
Re: What is the diffrence between $var and $$var
« Reply #1 on: May 02, 2012, 12:44:42 PM »
Hello Rahul,

    I think you will understand with this example so look at the code
            $var = 'hello';
             $$var = 'word';
            echo $hello;
     For example, the code creates a variable called $hello and outputs the string 'world'.  The double dollar sign     declares that the value of $var should be used as the name of newly defined variable.

Hope this will help you....!!!!!
« Last Edit: May 25, 2012, 04:48:32 AM by phpdeveloper »

Rahul Kaushik

  • Newbie
  • *
  • Posts: 18
Re: What is the diffrence between $var and $$var
« Reply #2 on: May 04, 2012, 11:16:06 AM »
HI,phpdeveloper.
                                   Thank you for Replay........ :-*

 

X

Do you know?

IfAndBut.com gives you a platform where you can ask questions related to web and internet..
So, why wait..
Join Now!
anything