當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CMbArray::ksortByArray方法代碼示例

本文整理匯總了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));
 }
開發者ID:fbone,項目名稱:mediboard4,代碼行數:7,代碼來源:CMbArrayTest.php

示例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);
開發者ID:fbone,項目名稱:mediboard4,代碼行數:31,代碼來源:ajax_vw_content_plan_soins_service.php


注:本文中的CMbArray::ksortByArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。