Problem:- Creating Dynamic Variable Name – $$ Uses Using PHP, Using braces with dynamic variable names in PHP, Dynamic Variables in PHP, How to Use PHP Variable Variables, php dynamic variable names in for loop, define dynamic variable in php, php $$variable double dollar sign, php variable variables array, php string to variable name, create different variables in loop php, php variable property name
Solution – Creating Dynamic Variable Name – $$ Uses Using PHP
<?php $lang = 'hindi'; $hindi = 12345; print $$lang; ?>
How it Works?
Placing two dollar sign before a variable name causes PP to dereference the right variable name to get a value. It then uses that value as the name of your real variable.
Leave a Reply