array variables

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lev444
Forum Newbie
Posts: 2
Joined: Thu Apr 07, 2011 5:51 am

array variables

Post by lev444 »

hi all,
please help with such problem:
I have several arrays like $v1, $v2, $v3...
I want to get all data from all arrays using "while". Tell me please how can I change numbers in array names ($v1, $v2) with another variable to use something like
while (is_array($vX) {
do something;
}
lev444
Forum Newbie
Posts: 2
Joined: Thu Apr 07, 2011 5:51 am

SOLVED: array variables

Post by lev444 »

Solved!
I've used
$i=1;
$k="v".$i;
while (is_array($$k)){
do something;
...
$i++;
$k="v".$i;
}
Post Reply