# PHP variable within variable

**URL:** <https://forum.kirupa.com/t/php-variable-within-variable/82831>\
**Category:** programming\
**Created:** [March 14, 2005, 2:45am UTC](https://forum.kirupa.com/t/php-variable-within-variable/82831 "2005-03-14T02:45:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vexir](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@Vexir](https://forum.kirupa.com/u/Vexir)\
**Post date:** [March 14, 2005, 2:45am UTC](https://forum.kirupa.com/t/php-variable-within-variable/82831/1 "2005-03-14T02:45:40Z")

</div>

I have this variable: $somecontent

I want to put the value of a bunch of other variables into it…

I tried

$somecontent = '$\_POST[‘opponent’] $\_POST[‘type’] $\_POST[‘map’] $\_POST[‘winlose’]  
$\_POST[‘yourscore’] $\_POST[‘theirscore’] $\_POST[‘mvp’]  
';

But that just outputted (when echoed)

$\_POST[‘opponent’] $\_POST[‘type’] $\_POST[‘map’] $\_POST[‘winlose’]  
$\_POST[‘yourscore’] $\_POST[‘theirscore’] $\_POST[‘mvp’]

How come?
