格式化模板调用参数 返回数组 Monxin专用(PHP代码函数)

来源:互联网 发布:太阳能充电 知乎 编辑:程序博客网 时间:2024/06/15 05:40
//格式化模板调用参数 返回数组 Monxin专用(PHP代码函数)//本代码基于Monxin 运行//代码来源:Monxin ./config/functions.phpfunction format_attribute($args){$args=trim($args,'(');$args=trim($args,')');$temp=explode('|',$args);$attribute=array();foreach($temp as $v){$temp2=explode(':',$v);$attribute[$temp2[0]]=@$temp2[1];if($temp2[0]=='field'){$temp3=explode('/',@$temp2[1]);$temp4='';foreach($temp3 as $v3){$temp4.='`'.$v3.'`,';}$temp4=trim($temp4,',');$attribute[$temp2[0]]=$temp4;}}return $attribute;}

0 0