Confused about string to var (using curly brackets) in a function
<p>Can anyone tell me why this works (it echos out "poo"):</p>

<pre><code>$input = "wee";
$val = "poo";
${$input} = $val;
echo $wee;
</code></pre>

<p>But this doesn't:</p>

<pre><code>function bodily($input) {
    $val = "poo";
    ${$input} = $val;
}
bodily("wee");
echo $wee;
</code></pre>

<p>I want to use this sort of method to play with some $_POST vars. Please tell me if I can explain more... Cheers!</p>
