PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

What is the differece between $message and $$message?


This is a good question and is one that springs up quite often from those learning PHP.

$message is the standard way to create a variable and then also to reference the value of that variable when we want to print it, whilst we can use $$ to actually print the name of that variable rather than its value:

<?php

$message 
"hello";

echo 
$message;//prints hello

echo "$$message";//prints $message
?>



Comment on this Question and Answer >>>

ASK A QUESTION

More other PHP Questions

How do I add comments to my PHP script?

How do I define a constant in PHP?

How do I find out about my PHP installation?

how can i put the value 1 or 0 into checkbox if we checked then 1 otherwise 0?

What are autoglobals?



Custom Search