I'll show you how you want, but will recommend using arrays.

<?php

 $A0 = '0';
 $A1 = '1';
 $A2 = '2';
 $A3 = '3';
 
 if (isset($A1))
 {
  $i = 0;
  $var_name = "A$i";
  while(isset($$var_name))
  {   
   // do something

   $i++;
   $var_name = "A$i";
  }
 }
?>

heres what you should be doing.

<?php

 $A[] = '0';
 $A[] = '1';
 $A[] = '2';
 $A[] = '3';
 
 if (isset($A))
  foreach($A as $pos => $val)
   // do something
?>

alot simpler, expandible and easier to read. Im sure its probably faster too...


-- 

 Chris Lee
 [EMAIL PROTECTED]


"Ekkard Gerlach" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi, 

n  variables reach  
my php-programm by submission: 

A0 
A1 
...
An 

Depending on Ai is set I want to run some 
actions. 

How can I evaluate Ai ??


if (isset (A1) then   # entrance
{ 
  i=0;
  while( isset($Ai)) {   /* Of course $Ai is not working !!! */
  { 
       $B= $Ai
      ... action ...
  }
}

I tried a lot with eval , with backticks, ...
but no suceess. 

Anybody an Idea? 

tia
Ekkard


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to