Reference variable are those that have a reference to the value stored in them for example
Here $name is a variable which stores name 'fruit' and in turn there is a memory location in your system when you run this program which is labelled as 'fruit' in which value is stored as $$name or $fruit.
$name = 'fruit'; //Generic Varible
$$name='banana'; //Reference Variable
echo $fruit;
//Outputs Banana
Here $name is a variable which stores name 'fruit' and in turn there is a memory location in your system when you run this program which is labelled as 'fruit' in which value is stored as $$name or $fruit.
No comments:
Post a Comment