I have a string that looks a little something like this:

```
$string = 'var1=foo&var2=bar&var3=blahblahblah&etc=etc';

```

And I would like to make another string from that, and replace it with a value, so for example it will look like this

```
$newstring = 'var1=foo&var2=bar&var3=$myVariable&etc=etc'; 

```

so var3 in the new string will be the value of `$myVariable`.

How can this be achieved?