AS to PHP translation of algorithm

Didn’t really know where to post this, so i’ll start here. I have an algorithm that I used in a project, but I now need the same thing in php and I have no idea how to do it. Do any of you flash/php developers have any idea? thanks :blush:
[AS] for (i=0; i<retArr.length; i++) {
var pk:String = retArr*;
if (this[“order”+pk] == undefined) {
this[“order”+pk] = new Array();
this[“order”+pk].push(retArr*);
orderArr.push(pk);
} else {
this[“order”+pk].push(retArr*);
}
}[/AS]

It might seem unlogic but I simplified some of the code, because it was irrelevant.