Question: I am new to PHP and I am trying to set multiple parameters to the same value.
I have done it the (probably) ugly way.

```
$thpic0 = "thpic_dummy";
$thpic1 = "thpic_dummy";
$thpic2 = "thpic_dummy";
$thpic3 = "thpic_dummy";
etc...
$thpic13 = "thpic_dummy";
$thpic14 = "thpic_dummy";

```

Since the only char changing is the last char in the parameters I thaught it could be done in a for-loop, but this (obviously) does not work:

```
//Reset th sorting pics
for($i=0;$i<=14;$i++)
{
$thpic{$i} = "thpic_dummy";
}

```

Is there another way I can do this without too many lines of code?

Answer: 
The correct syntax is `${…}` instead of `$…{…}`:

```
${"thpic$i"} = ...;

```

would be the valid syntax.

Some further PHP manual lecture about this: <http://php.net/language.variables.variable.php>
Your best bet is to probably put this into an array like this:

```
for ($i = 0; $i <= 14; $i++) {
    $thpic[$i] = "thpic_dummy";
}

print_r($thpic);

```

This returns something like this:
Array

```
(
    [0] => thpic_dummy
    [1] => thpic_dummy
    [2] => thpic_dummy
    [3] => thpic_dummy
    [4] => thpic_dummy
    [5] => thpic_dummy
    [6] => thpic_dummy
    [7] => thpic_dummy
    [8] => thpic_dummy
    [9] => thpic_dummy
    [10] => thpic_dummy
    [11] => thpic_dummy
    [12] => thpic_dummy
    [13] => thpic_dummy
    [14] => thpic_dummy
)

```

Which you could call like:

```
print $thpic[1]

```