What about using `usort` and use regex in the callback?
PHP Code: 
$array explode("\n",$input);
usort($array,function($a,$b){
    if(
get_part_num_of_a == get_part_num_of_b) return 0;
    return 
get_part_num_of_a<get_part_num_of_b?-1:1;
}); 
Or maybe not.
Apathetic Reviewed by Apathetic on . Sorting links but with something more.. How from thishttp://hosting1.com/juog3ax898v/stefan-te_part1.rar http://hosting1.com/5907h5gdg25/stefan-te_part2.rar http://hosting2.net/file/2592012/stefan-te_part1.rar http://hosting2.net/file/2591829/stefan-te_part2.rar http://hosting3.com/files/27020766/stefan-te_part1.rar http://hosting2.com/files/70689187/stefan-te_part2.rar To get this Hosting1: Rating: 5