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

Can PHP create PDF files for me?

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

Can I include Javascript in my PHP code?

What is a constant in PHP?

How can I add branching logic to my PHP code?



Custom Search