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

What does the @ character do in PHP?

What are autoglobals?

How do I add comments to my PHP script?

What is a constant in PHP?

How do I find the timestamp for a particular date?



Custom Search