{php $specials = explode(',',$r[special]);}
<div class="special">
{loop $specials $special}
{if $special==1}<span class="color_xhx">小户型</span>
{elseif $special==2}<span class="color_xf">现房</span>
{elseif $special==3}<span class="color_ppdc">品牌地产</span>
{elseif $special==4}<span class="color_sw">双卫</span>
{elseif $special==5}<span class="color_hyyf">花园洋房</span>
{elseif $special==6}<span class="color_bs">别墅</span>
{elseif $special==7}<span class="color_xxzb">学校周边</span>
{/if}
{/loop}
</div>