If the variable $a is equal to 5 and variable $b is equal to
character a, what’s the value of $$b?
Can anyone explain how's the value of $$b=100
Answers were Sorted based on User's Feedback
Answer / rajkumar
<?php
//If the variable $a is equal to 5 and variable $b is equal
to character a, what’s the value of $$b?
$a =5;
$b=$a;
$c= $$b;
print_r($c);
?>
it will not display any answer so answer is wrong
Is This Answer Correct ? | 3 Yes | 4 No |
Answer / nickle
$a = 5
$b = 'a'
$$b=100
bcoz $$b is a reference to existing variable.as $b=100 by
ascii...it is true.........!!!!
Is This Answer Correct ? | 2 Yes | 5 No |
Answer / modi[achir communication]
<?
$a=5;
$b='a';
$$b=100;
$b is a simple variable and $$b is a reference variable that
means in memory $$b will be refer to $b. Suppose in memory
$b variable is in address 100 then $$b will be refer $b at
address 100 that means $$b will contain 100.
?>
Is This Answer Correct ? | 11 Yes | 15 No |
Answer / annonymus
<?php
$a=5;
echo $b='a'."<br/>";
echo $$b;
?>
output is neither 5 or 100,
it displays
a
but if you try this...
<?php
$user = 'bob';
$holder = 'user';
echo $$holder;
?>
answer becomes like this..
bob
try it....this really really confusing..anyone can give the
exact solution to this????
Is This Answer Correct ? | 1 Yes | 6 No |
Answer / mr.kishore
<?php
$a=5;
$b='a';
$$b=100; // at this point $b='a' and when we use $ after
that '$$b becomes $a and we asign this value = 100 so $a
becomes 100;
echo $a;
Is This Answer Correct ? | 6 Yes | 37 No |
Specify array sort functions available in php ?
Can you use both this () and super () in a constructor?
difference between clanguage and c++
What is php good for?
what is difference between edit and update?
How to get the value of current session id?
Is key exist in array php?
hai, friend i srinu i had completed my graduation in 2004. now i am fineshed PHP course .may i get any oppartunity on php progr pls sugg me . thank u
Tell me what is the difference between characters 34 and x34?
what is the current salary package in India for a PHP & MySQL programmer who has 3 years experience
127 Answers ABC, BLG Logistics, Google, HCL, IBM, Infosys, People Group, PHP, Torque Infotech, V Angelz Technologies, Yahoo,
What is difference between session_unset and session_destroy?
Explain the different types of errors in php.