# Variable Variables within a For Loop?

**URL:** <https://forum.kirupa.com/t/variable-variables-within-a-for-loop/170524>\
**Category:** programming\
**Created:** [November 27, 2005, 4:21am UTC](https://forum.kirupa.com/t/variable-variables-within-a-for-loop/170524 "2005-11-27T04:21:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mistoflight](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mistoflight](https://forum.kirupa.com/u/mistoflight)\
**Post date:** [November 27, 2005, 4:21am UTC](https://forum.kirupa.com/t/variable-variables-within-a-for-loop/170524/1 "2005-11-27T04:21:57Z")

</div>

I working with form that depending on the user’s input creates a certain amount of input boxes which are given the name=‘step$num’. When I post the variables to the next page, I am trying to set the post values to a variable.

```php

for($i=1;$i<$maxsteps;$i++){
$step$i = $_POST['step$i'];
echo "$step$i";

```

This is obviously wrong, I think it has something to do with variable variables but I can’t find anything on this.  
Thanks a bunch. :beam:
