Hi,

Sunday, March 16, 2003, 8:20:49 AM, you wrote:
CK> Tom,

CK> This seems like what I need exactly, but I am having a bit of trouble 
CK> getting it to work.

CK> Here is how I have worked around this, but I know there is a 'real' way 
CK> to do this. Any thoughts? I had to set the variables, or should I just 
CK> use the variables as ${dra_0} etc.?

CK> // get the values for the default dra from array
CK> while(list($key,$val) = each($r_p_dras)){
CK>          $n = "dra_$key";
CK>          echo $n;
CK>          $$n = $val['dra_id'];
CK> }

CK> $dra_a = "${dra_0}";
CK> $dra_b = "${dra_1}";
CK> $dra_c = "${dra_2}";
CK> $dra_d = "${dra_3}";
CK> $dra_e = "${dra_4}";

You could use a seperate counter like this:
$x = 1;
while(list($key,$val) = each($r_p_dras)){
         $n = "dra_$x";
         echo $n;
         $$n = $val['dra_id'];
         $x ++;
}
-- 
regards,
Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to