You could probably use the usort() family of functions to sort it either on str or pos. You have to define your own comparison function for that.
Pseudo-PHP example:
function compareItems($a, $b)
{
if ( $a->pos < $b->pos ) return -1;
if ( $a->pos > $b->pos ) return 1;
return 0; // equality
}
uasort($yourArray, "compareItems");
Depending on your needs, other comparison functions might be more appropriate.