I read about variable variables in PHP's official documentation.

Here's a sample:

<?php
    $a = "hello";
    // Remove special characters and tags to prevent it from crashing.
    $foo = preg_replace('/[^a-zA-Z0-9\s]/', '', $$a);
    echo $foo;
?>

Not sure if this is a good practice but it sure gets the job done!