php: polymorphism on the iterator implementation of a array object?

lisxae

New Member
I don't know if a array is really a object on php ... but, what I want is to change the array behavior on a foreach loop.Something similar to this on java:\[code\]for( String it : myArr = new Array_Iterator( array) implements Iterator{ public Array_Iterator( String[] arr){ this.arr = arr} /* interface implementation */}){ /* loop */}\[/code\]What I really want to accomplish is a kind of filter, so that I don't get entries from the array that I don't want
 
Back
Top