---
title: "smarty中section输出数组"
author: "myfreespace"
date: "2011-01-12T14:45:30Z"
tags: ["PHP", "活动"]
categories: ["Web前端"]
slug: "smarty-section"
draft: false
lastmod: "2011-01-13T14:47:27Z"
id: 869248
url: "https://myfreespace.iteye.com/blog/869248"
---

```
			{section name=item loop=$arrfans}
			<div class="imgDiv">
				<a href="http://cyworld.ifensi.com/ps3/index.php?mh_id={$arrfans[item].user_id}"><img src="http://i.ifensi.com/icon.php?uid={$arrfans[item].user_id}&size=middle" width="50" height="50" alt="" /></a>
				<input type="checkbox" name="check1[]"  value='{$arrfans[item].user_id}' class="input"/><a href="http://cyworld.ifensi.com/ps3/index.php?mh_id={$arrfans[item].user_id}">{$arrfans[item].user_name}</a>
			</div>			
			{sectionelse}
			该活动暂无粉丝参与!
			{/section}
```

```
smarty 中直接打印输出数组 {$arrMsg.username}
```