我基於笨工作的一個小項目的陣列,我不是一個PHP開發人員,這是我的問題:排序數組PHP
foreach ($checkeds['id_iscritti'] as $checked){
$iscritto = $this->pellegrinaggio_iscritti_m->get_iscritto($checked);
$utente = $this->utenti_m->get_utente($iscritto[0]->id_utente);
echo ("utente: <pre> ");var_dump($utente);echo (" </pre> \n\n");
}
這是代碼,它基本上產生關聯陣列
,這就是我從獲得的var_dump:
array(1) { [0]=>
object(stdClass)#38 (27) {
["id"]=>
string(3) "254"
["nome"]=>
string(13) "Padre EDUARDO"
["cognome"]=>
string(9) "ANATRELLA"
}
}
utente:
array(1) {
[0]=>
object(stdClass)#37 (27) {
["id"]=>
string(3) "338"
["nome"]=>
string(4) "ELSA"
["cognome"]=>
string(5) "PAONE"
}
}
我怎麼可以排序的指數「諾姆」數組$個用戶? 我花了幾個小時,瞭解這種陣列如何工作,沒有任何結果,你能幫助我嗎?
發現糾正我,如果我錯了,但我敢肯定,'在array_multisort()'只排序數組的數組,而不是對象的數組? – RCrowt
看來你是對的,我錯過了。其他答案(你的)是正確的。 – KWeiss