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

smarty loops one-dimensional associative array_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:06:07
Original
874 people have browsed it

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

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>
Copy after login

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template