Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Difference between the and$ operator in php
$ operator
Operator is used to define variables in php. For example, message. Such variables can contain any type of value like int, string, etc.
$$ operator
$$ is a special operator that contains the name of another variable and can be used to access the value of that variable.
Example
Following the example, shows the usage of '′vs′$' operators.
<!DOCTYPE html>
<html>
<head>
<title>PHP Example</title>
</head>
<body>
<?php
$welcome = "message";
$message = "Welcome to Tutorialspoint";
echo $welcome;
print("<br/>");
echo $$welcome;
?>
</body>
</html>
Output
message Welcome to Tutorialspoint
Advertisements
