c语言sscanf函数的用法是什么
303
2022-09-21
php 嵌套多次循环for组成一维数组(多维数组变成一维数组)
表单传递过来的数据:
array(9) { ["tid747"] => array(2) { [0] => string(3) "163" [1] => string(3) "162" } ["pid"] => array(2) { [0] => string(3) "747" [1] => string(3) "750" } ["mid"] => array(2) { [0] => string(2) "14" [1] => string(2) "14" } ["tid750"] => array(1) { [0] => string(3) "162" } ["action"] => string(4) "edit" ["tid"] => string(3) "525" ["cid"] => string(3) "723" ["ccid"] => string(3) "728" ["id"] => string(3) "883"}
原多维数组:
array(2) { [0] => array(2) { [0] => array(2) { ["class_id"] => string(3) "883" ["province"] => string(3) "747" } [1] => array(2) { ["class_id"] => string(3) "883" ["province"] => string(3) "747" } } [1] => array(1) { [0] => array(2) { ["class_id"] => string(3) "883" ["province"] => string(3) "750" } }}
改变成一维数组:
array(3) { [0] => array(3) { ["class_id"] => string(3) "883" ["province"] => string(3) "747" ["tid"] => string(3) "163" } [1] => array(3) { ["class_id"] => string(3) "883" ["province"] => string(3) "747" ["tid"] => string(3) "162" } [2] => array(3) { ["class_id"] => string(3) "883" ["province"] => string(3) "750" ["tid"] => string(3) "162" }}
代码:
//保存表单试卷 if (request()->isPost()){ dump(input('')); //循环省份 if(count($pid)>0 && $id){ for($i=0;$i
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~