本文整理匯總了PHP中CMbArray::ksortByArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP CMbArray::ksortByArray方法的具體用法?PHP CMbArray::ksortByArray怎麽用?PHP CMbArray::ksortByArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CMbArray
的用法示例。
在下文中一共展示了CMbArray::ksortByArray方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testKsortByArray
public function testKsortByArray()
{
$array = array("key1" => "val1", "key2" => "val2", "key3" => "val3");
$order = array("key3", "key1", "key2");
$res = array("key3" => "val3", "key1" => "val1", "key2" => "val2");
$this->assertEquals($res, $this->stub->ksortByArray($array, $order));
}
示例2: foreach
if ($_prescription->_ref_lines_elt_for_plan) {
foreach ($_prescription->_ref_lines_elt_for_plan as $_elements_by_chap) {
foreach ($_elements_by_chap as $elements_cat) {
foreach ($elements_cat as $_element) {
$nb_lines_element += count($_element);
}
}
}
}
$bed = $_prescription->_ref_object->_ref_curr_affectation->_ref_lit;
$bedroom_name = $bed->_ref_chambre->nom . $bed->nom . $_prescription->_ref_object->_ref_curr_affectation->_id;
$prescriptions_order[$bedroom_name] = $key;
}
// Tri par numéro de chambre
ksort($prescriptions_order);
$prescriptions = CMbArray::ksortByArray($prescriptions, $prescriptions_order);
// Chargement des categories pour chaque chapitre
$categories = CCategoryPrescription::loadCategoriesByChap();
$smarty = new CSmartyDP();
$smarty->assign("lines", $lines);
$smarty->assign("patients", $patients);
$smarty->assign("tabHours", $tabHours);
$smarty->assign("prescriptions", $prescriptions);
$smarty->assign("categories", $categories);
$smarty->assign("tabHours", $tabHours);
$smarty->assign("composition_dossier", $composition_dossier);
$smarty->assign("bornes_composition_dossier", $bornes_composition_dossier);
$smarty->assign("count_composition_dossier", $count_composition_dossier);
$smarty->assign("operations", array());
$smarty->assign("nb_decalage", $nb_decalage);
$smarty->assign("mode_dossier", $mode_dossier);