php natsort有2个数组

I have this code :

$values_total[]=$file;
$values_total_data[]=$cmd_[$n];

natsort($values_total);

The first array called $values_total[] is numeric and have the number of simple txt files (154512452.txt, etc), with information inside, in a single line, but this array have only numeric values.

The second array called $values_total_data[] have the data line for each file

If i want, i can use natsort for get natural order by the letters or numbers

The problem it´s in this case i use this code for create select as in this example :

print "<select>";
$n=0;
foreach($values_total_data as $vals)
{
print "<option value='".$vals."'>".$values_total_data[$n]."</option>";
$n++;
}
print "</select>";

But the problem it´s that natsort order files by his id numeric number, and i need the order it´s for words inside in each file for get in first the title start for "a" "b", etc, but in select the option value must be numeric, and this numbers are inside $values_total[]

And i don´t know how i can combinate this for order by text and no by id of each text file, regards .

dongzhazhuo0572
dongzhazhuo0572 请你举个例子
大约一年之前 回复
dtz30833
dtz30833 array_multisortwithSORT_NATURAL
大约一年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问