Home  >  Article  >  Web Front-end  >  smarty loops one-dimensional associative array_html/css_WEB-ITnose

smarty loops one-dimensional associative array_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:06:07825browse

<?php$oStatusList = array('1'=>'待投放','2'=>'正在运行','3'=>'暂停','4'=>'已完成','5'=>'已删除');

The following is the loop on the page

<select name="oStatus" style="width:150px;">  <option value='0' >全部</option>   {foreach from=$oStatusList key=k item=v}   <option value={$k}>{$v}</option>   {/foreach}</select>

Since I am not familiar with smarty, I need this method today, find Arrived, write it down for easy reference next time

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn