Php Variable Variables

This is quite confusing but as soon as you see the logic, it would make sense.

Say you have this code:

1<?php
2
3$my_var= 'title';
4$$my_var = 'PHP variable variables'; // $my_var has a value of 'title'. So the 2nd '$' makes it $title
5echo $title;                         // ...so, YOU see now where you will get the variable $title

Output is:

1PHP variable variables

See details in https://www.phptutorial.net/php-tutorial/php-variable-variables/