I’m little confused as in how can I use do-while loop in an associative array in php. I don’t have ordered indexes starting from 0 so I can’t iterate simple as in case of C or Java
NOTE :: I specifically want do-while sort of behavior…i.e. loop s’d execute atleast once in the beginning
You can use the array_keys function.
If you really want to use a do-while loop. But if a simple while loop is good for you, the first if isn’t neccessary:
edit:
If you really want your loop to run at least once: