answersLogoWhite

0


Best Answer

A double dollar sign in php makes a variable with a name equal to the value of the original variable. It works like this:

$var = "keith";

$$var = "palmer";

print ($keith);
// The output is: palmer

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the Use of a double dollar sign in php?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Basic Math

What is the Use of a dollar sign in php?

the dollar sign appears before a variable/array. Essentially it just tells php that its a variable. $food = "cheese pizza"; or $myfavoritenumber = 2 ;


All variables in PHP start with which symbol?

In PHP, all variables must the preceded by the dollar sign. Variable name must not contain any space as well.


What is the difference between single quotes and double quotes in PHP?

There's not too much of a difference. Most people prefer using double quotes because of the fact that you can do this: <?php $var2 = "Look at {$var1}!"; ?> which you can't do the {} thing with single quotes. You would have to do <?php $var = 'Look at '.$var1.'!'; ?>


In PHP you can use both single quotes ( ' ' ) and double quotes ( ) for strings?

You can use single quotes $variable = 'string'; You can use double quotes $variable = "string"; You can use the Heredoc method $variable = <<<EOT Very Long String EOT; And you can use the Nowdoc method (after PHP 5.3.0) $variable = <<<'EOT' Very Long String EOT;


What are variables in PHP?

PHP variables are variables are written in a way which is similar to JavaScript. To define a PHP variable, you will need to add a dollar sign ($) preceding the unique name you will give to your variable. Next, you will give the variable a value by typing an equals sign (=) then a value surrounded by quotes. NOTE: If you are going to have quotes in the value, the make sure you type that quote as ", not /". After your done, you will end the command by adding a semicolon (;). Your code should look like the example below: $name = "value"; There you go, you got yourself a simple variable.

Related questions

What is the Use of a dollar sign in php?

the dollar sign appears before a variable/array. Essentially it just tells php that its a variable. $food = "cheese pizza"; or $myfavoritenumber = 2 ;


What is the difference between variable and doubledollar sign in php?

I believe that in PHP syntax, double dollar sign is used when it is needed to pass on a variable, that has not yet been defined. Generally, this feature is not safe to use a can result in errors. Every algorithm which needs this kind of element, can also be handled by other means.


All variables in PHP start with which symbol?

In PHP, all variables must the preceded by the dollar sign. Variable name must not contain any space as well.


What is the use of a question mark in php?

It is used to tell the sever to use the PHP parser. To begin php you must use <?php, and to end it, it is ?>.


Which sign is used to concatenate two strings?

That depends on the programming language. Most languages use the "+" sign, but a few use other signs. For example, PHP uses the dot.


How do you use PHP in HTML?

You can't use PHP in an HTML document, but you can use HTML in PHP script.


What is the use of the double equal sign?

In programming languages, the equals sign may either denote a boolean operator to test equality of values (sometimes a double equal sign "=="), or it may denote an assignment (sometimes denoted with a colon-equals ":="). In some programming languages such as PHP a double equals sign ("==") denotes equivalence, meaning that the variables may not be of the same data type, but their values can be reduced to the same value. The triple equal sign ("===") denotes identity, meaning that not only do the two values parse to be the same, they are of the same data type. For instance, in PHP the expression ("0 false") is not, because the number 0 is an integer value, whereas false is a Boolean.


How much is one dollar in Philippines?

44.60990 php.


What is the difference between single quotes and double quotes in PHP?

There's not too much of a difference. Most people prefer using double quotes because of the fact that you can do this: <?php $var2 = "Look at {$var1}!"; ?> which you can't do the {} thing with single quotes. You would have to do <?php $var = 'Look at '.$var1.'!'; ?>


In PHP you can use both single quotes ( ' ' ) and double quotes ( ) for strings?

You can use single quotes $variable = 'string'; You can use double quotes $variable = "string"; You can use the Heredoc method $variable = <<<EOT Very Long String EOT; And you can use the Nowdoc method (after PHP 5.3.0) $variable = <<<'EOT' Very Long String EOT;


How do you rectify HTML to PHP variable error?

To use HTML as variable in PHP . echo the html tag written in double quotes. Example : <?php echo "<table>"; echo "<tr><td></td><td></td></tr>" echo "</table>"; ?>


What is the default extension that most Web servers use to process php scripts?

PHP files extension is .php