【php开源代码栏目提醒】:网学会员,鉴于大家对php开源代码十分关注,论文会员在此为大家搜集整理了“function.html_multiarray.php”一文,供大家参考学习!
<?php
function tpl_function_html_multiarray($params, &$smarty)
{
foreach($params as $_key => $_val) {
switch($_key) {
case 'val':
$$_key = (string)$_val;
break;
case 'in':
$$_key = (array)$_val;
break;
case 'match':
case 'display':
$$_key = (string)$_val;
break;
case 'none':
$$_key = (string)$_val;
break;
default:
$tpl->trigger_error("not a expect val", E_USER_NOTICE);
break;
}
}
$temp = array();
foreach($in as $key=>$val){
$temp[$in[$key][$match]] = $in[$key][$display];
}
if(array_key_exists($val,$temp))
{
$_html_result = $temp[$val];
}
else
{
$_html_result = $none;
}
return $_html_result;
}
?>