Wednesday, April 25, 2018

Difference between $variable and $$variable.


$variable is a normal variable $$variable takes the value of a variable and treats that as the name of a variable

<?php
 $var="Hello world";
 $$var1="var";
 echo $$var1;
?>
 outPut:
  Hello world
 
  Here:
  $var : Representa a variable.
  $$var1: Represents a variable with content of $var.

No comments:

Post a Comment

Featured Post

What is JavaScript? What is the role of JavaScript engine?

  The JavaScript is a Programming language that is used for converting static web pages to interactive and dynamic web pages. A JavaScript e...