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中多维数组的遍历的更多相关文章
- 数组的三种声明方式总结、多维数组的遍历、Arrays类的常用方法总结
1. 数组的三种声明方式 public class WhatEver { public static void main(String[] args) { //第一种 例: String[] test ...
- 数组的三种方式总结 多维数组的遍历 Arrays类的常用方法总结
一.数组的三种声明方式总结 public class WhatEver { public static void main(String[] args) { //第一种 例: String[] tes ...
- 元素均匀排列自动换行&二维数组前端遍历
1.元素均匀排列并自动换行 display:flex; flex-wrap:wrap; 2.getFiled();取一行,取多行的话用getFiled(‘id’,true); 3.二维数组前端遍历: ...
- C++ 性能小测 1 二维数组的遍历效率
C++ 性能小测 1 二维数组的遍历效率 遍历二维数组时,常规思路是使用一个嵌套循环.一方面,由于 CPU 使用了分支预测技术,因此通常将循环次数最多循环的放在最内层.另一方面,由于二维数组是按行存储 ...
- c语言中双维数组与指针的那点事儿
说起c语言的指针,估计对c语言只是一知半解的同志们可能都会很头疼,尤其它跟数组又无耻的联系到一起的时候,就更加淫荡了!!! 怎么说呢,就是有一点规定:(或准则) 数组名可以看成是指向数组头元素的指针, ...
- js中多维数组转一维
法一:使用数组map()方法,对数组中的每一项运行给定函数,返回每次函数调用的结果组成的数组. var arr = [1,[2,[[3,4],5],6]]; function unid(arr){ v ...
- C++中多维数组传递参数
在c++自定义函数时我们有时需要传递参数,有时以多维数组作为参数,这里就遇到了多维数组该怎么传值的问题了,首先我们看看一维数组是怎么做的. void print_num(int num[], int ...
- CUDA中多维数组以及多维纹理内存的使用
纹理存储器(texture memory)是一种只读存储器,由GPU用于纹理渲染的图形专用单元发展而来,因此也提供了一些特殊功能.纹理存储器中的数据位于显存,但可以通过纹理缓存加速读取.在纹理存储器中 ...
- PHP中多维数组查找某个值是否存在的方法
in_array — 检查数组中是否存在某个值,只是这个方法不能检查多维数组. 所以可以编写类似下面的递归方法来检查多维数组. function deep_in_array($value, $arra ...
随机推荐
- 【HDOJ】2890 Longest Repeated subsequence
后缀数组的应用.和男人八题那个后缀数组差不多. /* 2890 */ #include <iostream> #include <sstream> #include <s ...
- js createElement
http://www.w3schools.com/js/js_htmldom_nodes.asp var child = document.getElementById("p1" ...
- 函数flst_init
/** The null file address */UNIV_INTERN fil_addr_t fil_addr_null = {FIL_NULL, 0}; /***************** ...
- [POJ 2461] Billiard
同swustoj 11 Billiard Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1362 Accepted: 8 ...
- angularjs的事件 $broadcast and $emit and $on
angularjs的事件 $broadcast and $emit and $on <!DOCTYPE html> <html> <head> <meta c ...
- C# 中 string.Empty、""、null的区别
原文C# 中 string.Empty."".null的区别 一.string.Empty 和 "" 1.Empty是string类中的一个静态的只读字段,它是 ...
- Cppcheck代码分析(1)
一.检查点 1.自动变量检查: 返回自动变量(局部变量)指针 2.越界检查: 数组越界返回自动变量(局部变量)指针 3.类检查: 构造函数初始化 4.内存泄露检查: 5.空指针检查: 6.废弃函数检查 ...
- leetcode@ [318] Maximum Product of Word Lengths (Bit Manipulations)
https://leetcode.com/problems/maximum-product-of-word-lengths/ Given a string array words, find the ...
- 【zoj3254】Secret Code
题意: 给出a.p.d.m 求a^x=d(mod p) 0<=x<=m 的解的个数 题解: 今天一整天的时间大部分都在调这题Orz BSGS什么的还是太不熟了 我们可以用BSGS拓展版求出 ...
- Mongodb 和 普通数据库 各种属性 和语句 的对应
SQL to MongoDB Mapping Chart In addition to the charts that follow, you might want to consider the F ...