Для array_multisort() попробуйте вот такой код
<?php
$str = '2312312321312312 asadas-dasdasdads.ru MIT-1.3.2/14-29
23123123 asadewrewras-deewrewrasdasdads.ru MIT-1.4.1/13-29
2312312321312312 asadas-dasdasdads.ru MIT-1.3.2/2-29
232222 aFEWFWewsadas-dasdasdads.ru MIT-1.3.4/12-30
99999 aFEWFWewrrwerweadas-dasdasdads.ru MIT-1.4.1/4-6 #1
299311 rewrwerwerx.net MIT-1.2.2/8-46
900301834 werwerwerw.net MIT-1.3.3/20-13';
$arr = preg_split('/\r?\n/', $str);
$sort_data = [];
foreach ($arr as $i => $line) {
$pos = strpos($line, 'MIT');
if ($pos !== false) {
$tmp = substr($line, $pos);
$sort_data[$i] = $tmp;
}
}
array_multisort($sort_data, SORT_ASC, SORT_REGULAR, $arr);
var_dump($arr);
Вывод:
array(7) {
[0]=>
string(37) "299311 rewrwerwerx.net MIT-1.2.2/8-46"
[1]=>
string(53) "2312312321312312 asadas-dasdasdads.ru MIT-1.3.2/14-29"
[2]=>
string(52) "2312312321312312 asadas-dasdasdads.ru MIT-1.3.2/2-29"
[3]=>
string(40) "900301834 werwerwerw.net MIT-1.3.3/20-13"
[4]=>
string(50) "232222 aFEWFWewsadas-dasdasdads.ru MIT-1.3.4/12-30"
[5]=>
string(58) "23123123 asadewrewras-deewrewrasdasdads.ru MIT-1.4.1/13-29"
[6]=>
string(56) "99999 aFEWFWewrrwerweadas-dasdasdads.ru MIT-1.4.1/4-6 #1"
}