0

I want to know about meaning of $$val; what is the actual meaning is?i tried to find meaning of this in google but not understand properly. Please help me in this situations.

For example: suppose i have one variable which has $$value; meaning of $$value?

viral m
  • 147
  • 1
  • 8

1 Answers1

1

You didn't put the language, but I'll assume you mean PHP

That's a variable variable.

That means you ware asking for the value of the variable whose name.is the first variable.

Here's an example, since that's quite confusing:

$foo = "Hi";
$bar = "world";
$world = "Hello!";

echo $$bar; // "Hello!"

php fiddle: http://ideone.com/Ve4YOO

Reference: https://secure.php.net/manual/en/language.variables.variable.php

Drazisil
  • 3,070
  • 4
  • 33
  • 53