Working with Dynamic variable names a/k/a Variable variables in PHP

1 · Josh Sherman · May 3, 2015, midnight
Variable variables are one of my favorite things about PHP. PHP allows you to use a variable to reference another variable. This comes in exceptionally handy when you need to create variable names dynamically: $variable = 'This is my variable'; $var = 'variable'; echo $$var; Let’s say you have you......