Re: how to combine the results of two variables to echo another variable?



There is no need for variable variables at all. Use arrays for stuff like this. Yeah, v-vars are indeed powerfull, powerfull to lead ppl to unpredictable clutter up the root of the namespace and write ugly code -- like demonstrated below in all beauty.

On 29.04.2005 00:51, Sacs wrote:
Ewoud Dronkert wrote:

Variable variables are one of the most powerfull features of php I've found. Very usefull when you dont know how many variables to be processed in a form for e.g.

for( $i=1; $i <= $num_fields; $i++) {
      $blah = "field_" . $i;
      // $blah is now "field_1" first time through the loop

      $blah = $$blah;
      // now $blah holds what was input into the appropriate input
}

.