Iterating through a hash array

Piccolo

Well-known member
How do you iterate through a hash array (that is an array whose indexes are not 0, 1, 2, 3, ...) ?

I just need a way to access variables contained in such arrays in order to free them.

I saw they were functions like "next" and "key" available, but I couldn't get anything from them.
 
You could brute force it with a do/while loop that searches for the value you're after, but there's probably a more elegant way I'm not thinking of.

DC
 
I don't think I can do that, because I don't know the keys and don't have access to them.

I solved my problem using "reset(array)" function (which seems to free each element of the given array), but anyway I'm still interested by the initial question.
 
Back
Top Bottom