帝国cms灵动标签调用信息时输出TAG信息

[size=14]2种方法差不多,一种是for,一种是foreach。[/size] [size=14]方法1:[/size] [code][e:loop={34,10,0,0}] fetch1("select infotags from {$dbtbpre}ecms_{$class_r[$bqr['classid']]['tbname']}_data_{$bqr['stb']} where id='{$bqr['id']}'"); $TagArr = explode(',', $fr['infotags']); for ($i = 0; $i < count($TagArr); $i++) { if($TagArr[$i]){ $tagStr .= '' . $TagArr[$i] . ''; } } ?>
[/e:loop][/code][size=14]方法2:[/size] [code][e:loop={34,10,0,0}] fetch1("select infotags from {$dbtbpre}ecms_{$class_r[$bqr['classid']]['tbname']}_data_{$bqr['stb']} where id='{$bqr['id']}'"); $TagArr = explode(',', $fr['infotags']); foreach ($TagArr as $k => $v) { if($v){ $tagStr .= '' . $v . ''; } } ?>
[/e:loop][/code]
已邀请:

要回复问题请先登录注册