How can i detect if some dynamic variable exists?

I was create some variables (reading array with each() function) like:

"Variable".$counter

on the next page I have to write all
"Variable".$counter variables.
How can I do that?
Tried with isset(), but its neverending loop.

Thanks

    Unless I am mistaken "Variable".$counter would not be a variable. Only $counter would be. If you want more than one variable (a dynamic variable, as you called it) then what you really need is a dynamic array of a variable. You would instead use $Variable[$counter]. Then when you want to retrieve the values you can use a loop like:

    For($i=0;$i<=count($Variable);$i++) {
    echo $Variable[$i];
    }

    Hope that helps,
    Richard

      Write a Reply...