往往在取得用户uid后,通过函数取得姓名,然后组合为数组输出拱smarty使用的示例!
<?php
$arry_all[2] =array("uid"=>001,"sex"=>"man");
$arry_all[3] =array("uid"=>001,"sex"=>"man");
$arry_all[4] =array("uid"=>001,"sex"=>"man");
$arry_all[5] =array("uid"=>001,"sex"=>"man");
$arry_all[6] =array("uid"=>001,"sex"=>"man");
$name_array = array(array("name0"=>"jianxin","name1"=>"zhujianxin"),"zaifeng","xichen","xiangdong","wangfang");
$i=0;
foreach($arry_all as $k=>$v)
{
$arry_all[$k]['name']=$name_array[$i];
$i=$i+1;
}
print_r($arry_all);
?>
$arry_all[2] =array("uid"=>001,"sex"=>"man");
$arry_all[3] =array("uid"=>001,"sex"=>"man");
$arry_all[4] =array("uid"=>001,"sex"=>"man");
$arry_all[5] =array("uid"=>001,"sex"=>"man");
$arry_all[6] =array("uid"=>001,"sex"=>"man");
$name_array = array(array("name0"=>"jianxin","name1"=>"zhujianxin"),"zaifeng","xichen","xiangdong","wangfang");
$i=0;
foreach($arry_all as $k=>$v)
{
$arry_all[$k]['name']=$name_array[$i];
$i=$i+1;
}
print_r($arry_all);
?>
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/1613/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
评论列表