thinPHP中多维数组的遍历

$drug=array(
   ‘ACEI‘=>array(array(‘ch_name‘=>‘卡托普利‘,‘en_name‘=>‘captopril‘),array(‘ch_name‘=>‘依那普利‘,‘en_name‘=>‘enalapril‘),
       array(‘ch_name‘=>‘赖诺普利‘,‘en_name‘=>‘lisinopril‘)),
   
   ‘ARB‘=>array(array(‘ch_name‘=>‘依普罗沙坦‘,‘en_name‘=>‘eprosartan‘), array(‘ch_name‘=>‘坎地沙坦‘,‘en_name‘=>‘candesartan‘),
      array(‘ch_name‘=>‘氯沙坦‘,‘en_name‘=>‘losartan‘),array(‘ch_name‘=>‘缬沙坦‘,‘en_name‘=>‘valsartan‘),
      array(‘ch_name‘=>‘厄贝沙坦‘,‘en_name‘=>‘irbesartan‘)),
  );

<foreach name="drugs" item="vo" key="k">
    <label class="checkbox">
     <input type="checkbox" name="{$k}" value="1">{$k}
    </label>
     <foreach name="vo" item="drug">
      <label class="checkbox inline drug">
       <input type="checkbox" name="{$drug.en_name}" value="1">{$drug.ch_name}
      </label>
     </foreach>
  </foreach>

thinPHP中多维数组的遍历,布布扣,bubuko.com

thinPHP中多维数组的遍历

上一篇:js面向对象编程:命名空间


下一篇:[Angular 2] Generate and Render Angular 2 Template Elements in a Component