difference between $message and $$message

difference between $message and $$message

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

View Answers

December 27, 2010 at 1:36 PM

Hi friends,

$message is a simple variable whereas $$message is a reference variable. Example: $name = 'Bharat';

is equivalent to

$str = 'name'; $$str = 'Bharat';

Example:

<html>
<head>
<title>First PHP Example </title>
</head>
<body>
<?php

/*----------------- First -----------------*/
$name="bharat";
echo $name;
echo "<br>";

/*-----------------Second -----------------*/
$str = 'name';
echo $str;
echo "<br>";
$$str;
echo  $$str;
?>
</body>
</html>

Thanks.









Related Tutorials/Questions & Answers:
What is the difference between $message and $$message?
What is the difference between $message and $$message?  What is the difference between $message and $$message
difference between $message and $$message
difference between $message and $$message  What is the difference between $message and $$message?   Hi friends, $message is a simple variable whereas $$message is a reference variable. Example: $name = 'Bharat
Advertisements
message passing
message passing  how message is passed using jade technology
message box
message box  How to show the message "invalid username and password" after redirecting the page to the login form
Difference between DispatchAction and LookupDispatchAction
Difference between DispatchAction and LookupDispatchAction  What is the Difference between DispatchAction and LookupDispatchAction
difference between SessionState and ViewState
difference between SessionState and ViewState  What is the difference between SessionState and ViewState
difference between ForwardAction and IncludeAction
difference between ForwardAction and IncludeAction  What is the difference between ForwardAction and IncludeAction
Difference between struts and JSF
Difference between struts and JSF  What is the difference between struts and JSF
difference between == and === operators?
difference between == and === operators?  Is (====) operator available in java or not? difference between
How to develope web service with exachanging xml message between computers using SOAP
How to develope web service with exachanging xml message between computers using SOAP  Hi Friends, I want to developed a webservice using soap... program in order to receive the message and client side program in order
Java Message Services - JMS
Java Message Services  What is Java Message Services
difference between varchar & varchar2?
difference between varchar & varchar2?  What is the difference between varchar & varchar2
Difference between 3d and 4d
Difference between 3d and 4d  what is the difference between 3d and 4d
What is the difference between the >> and >>> operators?
What is the difference between the >> and >>> operators?   hi, What is the difference between the >> and >>> operators? Thanks
Objective C Message Passing
Objective C Message Passing  What exactly a message passing means in Objective C? and how can i pass a message to a method
Message Resource Bundle work.
Message Resource Bundle work.  How does Value replacement in Message Resource Bundle work
Message Context in AXIS
Message Context in AXIS  Is there any method in Axis classes to het the size of IN and OUT Message Conetext
Javascript alert message
Javascript alert message   How to send an alert message to a user in JavaScript
ModuleNotFoundError: No module named 'message'
ModuleNotFoundError: No module named 'message'  Hi, My Python... 'message' How to remove the ModuleNotFoundError: No module named 'message... to install padas library. You can install message python with following command
javascript dom error-message
javascript dom error-message  javascript dom error-message
how to send message
how to send message  how to send message for mobile in server
Difference between Mysql and SQL
Difference between Mysql and SQL  hello, What is the difference between Mysql and SQL??   hii,ADS_TO_REPLACE_1 SQL is structural quary language but mysql is database package
Difference between Timer and Thread?
Difference between Timer and Thread?  Can anyone tell me about the difference between Timer and Thread, Why we need to have Timer in case we have Thread implimentation startegy in Java
websphere message broker - WebSevices
websphere message broker  how can i find the heapsize of the execution group in the message broker using command console syntax
what is the difference between extends and implements
what is the difference between extends and implements  difference between extends and implements
what is the difference between extends and implements
what is the difference between extends and implements  difference between extends and implements
soap message console - WebSevices
soap message console  hi friends i have one doubt that is iam using MyEclipse 6.0 in that how do i get soap message console
Difference between SCJP Exams
Difference between SCJP Exams  What is the differences between SCJP 5 (310 - 055) exam and SCJP 6 (310 - 065) exam??? Thank You In Adv
Difference between JSP and Servlets
Difference between JSP and Servlets  What is the difference between JSP and Servlets ?   JSP is used mainly for presentation only. A JSP can only be HttpServlet that means the only supported protocol in JSP is HTTP
difference between lock and synchronization
difference between lock and synchronization  Hi, I am new in java please anyone tell me difference between lock and synchronization in java. its urgent. Thank in advance   Please visit the following link: Lock
GETTING ALERT MESSAGE
GETTING ALERT MESSAGE  how to get an alert message when radio button is selected instead of checkbox
Java Message Services
consumers can get the message. There is a timing dependency between publishers... Java Message Services      ... for developing programs using it. The java message services API is a java Message oriented
Difference between request.getRequestDispatcher() and context.getRequestDispatcher()
Difference between request.getRequestDispatcher() and context.getRequestDispatcher()  What is the difference in using request.getRequestDispatcher() and context.getRequestDispatcher()?   request.getRequestDispatcher
message driven bean example
message driven bean example  can any one tell me how to develop and execute ---------- j2ee message driven bean example in weblogic server with (netbeans or eclipse).   Have a look at the following link: http
GETTING AN ALERT MESSAGE
GETTING AN ALERT MESSAGE  how to get an alert message, if i select radio button instead of checkbox(associated with 3 dropdown list
forward error message in struts
forward error message in struts  how to forward the error message got in struts from one jsp to other jsp?   Hello Friend, Use <%@ page... message to the specified jsp page. For more information, visit hereADS
Difference between forward and sendRedirect
Difference between forward and sendRedirect  What's the difference between forward and sendRedirect?   RequestDispatcher.forward() and HttpServletResponse.sendRedirect() are the two methods available for URL redirecting
Difference between ServletContext and ServletConfig
Difference between ServletContext and ServletConfig   What is the difference between ServletContext and ServletConfig?   ServletContext :Defines a set of methods that a servlet uses to communicate with its servlet
Difference between translate and replace
Difference between translate and replace   hiii, What is the difference between translate and replace?   hello,ADS_TO_REPLACE_1 Replace replace every instence of character with character sting by the given charator
Difference between GET and POST
Difference between GET and POST   Difference between GET and POST ?   The difference between a GET and a POST is the way data is transferred to a servlet. With a GET, the URL will show each name/value pair on the query
Message Driven Beans
Message Driven Beans       Message driven beans are the light weight components used for communication. In message driven beans the messaging service is in asynchronous mode because
A Message-Driven Bean Example
A Message-Driven Bean Example   ... messages asynchronously,  a Message-driven bean is used. Message driven..., email or IM messages). In message driven beans, the messaging service
validation message - Struts
validation message  sir, i took help of that example but in that we change only color of the message i want to shift the place of the error message.means all messages are put together at top of the form
What is the difference between PHP4 and PHP5?
What is the difference between PHP4 and PHP5?  What is the difference between PHP4 and PHP5
What is difference between a PROCEDURE & FUNCTION ?
What is difference between a PROCEDURE & FUNCTION ?  What is difference between a PROCEDURE & FUNCTION
Difference between XML and HTML - XML
Difference between XML and HTML  What is the basic Difference between XML and HTML
difference between <%@ include ...> and <jsp:include>
difference between <%@ include ...> and   What is the difference between <%@ include ...> (directive include) and <jsp:include>
what is the Difference between weblogic and jboss?
what is the Difference between weblogic and jboss?  what is the Difference between weblogic and jboss
what is the difference between pop and oop
what is the difference between pop and oop  what is the difference between pop and oop
difference between hashcode,reference in java
difference between hashcode,reference in java  difference between hashcode,reference in java

Ads