本文整理匯總了PHP中Str::selected方法的典型用法代碼示例。如果您正苦於以下問題:PHP Str::selected方法的具體用法?PHP Str::selected怎麽用?PHP Str::selected使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Str
的用法示例。
在下文中一共展示了Str::selected方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
<script type="text/javascript" src="/scripts/jquery/jquery.inplace.min.js"></script>
<form method="get" id="list">
<fieldset>
<legend>搜索</legend>
核審狀態:<select name="status">
<option value="">請選擇</option>
<option value="0" <?php
echo Str::selected($status, '0');
?>
>未審</option>
<option value="1" <?php
echo Str::selected($status, '1');
?>
>已審</option>
<option value="2" <?php
echo Str::selected($status, '2');
?>
>每月係統扣分</option>
</select>
用戶名: <input type="text" name="uname" size="20" value="<?php
echo $uname;
?>
" />
<input type="submit" value=" 搜 索 " />
</fieldset>
<table class="tablegrid" width="100%" style="text-align:center;">
<tr>
<th align="left" width="50"><input type="checkbox" name="chkAll" /> 全選</th>
<th>ID</th>
<th align="left">用戶名</th>
示例2: date
<tr><td><b>狀態:</b></td><td>
<select name="status" >
<option value="approved" <?php
echo Str::selected('approved', $userInfo['status']);
?>
> 通過</option>
<option value="overtime" <?php
echo Str::selected('overtime', $userInfo['status']);
?>
> 過期</option>
<option value="disapproval" <?php
echo Str::selected('disapproval', $userInfo['status']);
?>
> 凍結</option>
<option value="forbid" <?php
echo Str::selected('forbid', $userInfo['status']);
?>
> 禁止</option>
</select>
</td></tr>
<tr><td><b>新密碼:</b></td><td><input type="text" size="50" value="" name="password" class="text" gtbfieldid="46" /></td></tr>
<tr><td><b>到期時間:</b></td><td><input type="text" size="50" value="<?php
echo date('Y-m-d', $userInfo['expire_time']);
?>
" name="expire_time" class="date" gtbfieldid="46"></td></tr>
<tr><td><b>用戶備注:</b></td><td><textarea cols="100" rows="5" name="memo"><?php
echo $userInfo['memo'];
?>
</textarea></td></tr>
示例3:
<form method="get" id="list">
<fieldset>
<legend>搜索</legend>
發送狀態:
<select name="status" >
<option value="-1"> 全部</option>
<option value="0" <?php
echo Str::selected('0', $status);
?>
>未發送</option>
<option value="1" <?php
echo Str::selected('1', $status);
?>
>發送失敗</option>
<option value="2" <?php
echo Str::selected('2', $status);
?>
>已發送</option>
</select>
用戶名: <input type="text" name="username" size="20" value="<?php
echo $username;
?>
" />
插入時間:<input type="text" id="start_date" name="start_date" class="date" value="<?php
echo $start_date;
?>
" size="10"/> ~ <input type="text" id="end_date" name="end_date" class="date" value="<?php
echo $end_date;
?>
示例4:
?>
>越早上傳越靠前</option>
</select>
每頁顯示數量
<select name="page_num" >
<option value="0">請選擇</option>
<option value="20" <?php
echo Str::selected($page_num, '20');
?>
>20</option>
<option value="40" <?php
echo Str::selected($page_num, '40');
?>
>40</option>
<option value="60" <?php
echo Str::selected($page_num, '60');
?>
>60</option>
</select>
<input type="submit" value="" class="search_true"/>
</fieldset>
</form>
<form action="" method="post" id="picList">
<input name="cate_id" type="hidden" value="<?php
echo $cate_id;
?>
" />
<ul class="cate_list yoxview">
<?php
foreach ($results as $key => $item) {
示例5: date
</td></tr>
<tr><td><b>到期時間:</b></td><td><?php
echo date('Y-m-d', $userInfo['expire_time']);
?>
</td></tr>
<tr><td><b>升級到:</b></td><td>
<select name="group" >
<?php
foreach ($group as $item) {
if ($item['id'] != 1) {
?>
<option value="<?php
echo $item['id'];
?>
" <?php
echo Str::selected($userInfo['rank'], $item['id']);
?>
> <?php
echo $item['group_name'];
?>
:<?php
echo $item['max_space'];
?>
</option>
<?php
}
}
?>
</select>
</td></tr>
<tr><td><b>付款方式:</b></td><td>
示例6: foreach
echo $roleId;
?>
&mod_name=<?php
echo $modName;
?>
" method="post" name="aclAssign" id="aclAssign" class="allowKeySubmit">
<div style="border-bottom:4px solid #DEEFFA; padding:10px 0; +padding-bottom:0;">
<select name="role_id">
<?php
foreach ($roles as $role) {
?>
<option value="<?php
echo $role['role_id'];
?>
" <?php
echo Str::selected($role['role_id'], $roleId);
?>
><?php
echo $role['role_name'];
?>
(<?php
echo $role['role_desc'];
?>
)</option>
<?php
}
?>
</select>
<input type="submit" name="saveAssign" value=" 保存設定 " />
<input type="reset" name="resetAssign" value=" 重置表單 " />
</div>
示例7:
</select> <input type="text" name="points" size="5" value="<?php
echo $points;
?>
" />
</fieldset>
<fieldset>
時間
<select name="time_type">
<option value="reg_time" <?php
echo Str::selected('reg_time', $time_type);
?>
>注冊時間</option>
<option value="expire_time" <?php
echo Str::selected('expire_time', $time_type);
?>
>過期時間</option>
</select><input type="text" id="start_date" name="start_date" class="date" value="<?php
echo $start_date;
?>
" size="10"/> ~ <input type="text" id="end_date" name="end_date" class="date" value="<?php
echo $end_date;
?>
" size="10"/>
<input type="checkbox" name="index_top" value="1" onclick="this.form.submit();" <?php
if ($index_top) {
echo 'checked="checked"';
}
?>
/> 明星用戶
示例8: foreach
>創建</option>
<option value="2" <?php
echo Str::selected('2', $status);
?>
>取消</option>
</select>
<select name="group_id">
<option value="-1">全部</option>
<?php
foreach ($groups as $item) {
?>
<option value="<?php
echo $item['id'];
?>
" <?php
echo Str::selected($item['id'], $group_id);
?>
><?php
echo $item['group_name'];
?>
</option>
<?php
}
?>
</select>
用戶名: <input type="text" name="username" size="10" value="<?php
echo $username;
?>
" />
操作時間:<input type="text" id="start_date" name="start_date" class="date" value="<?php
示例9: current
echo $modName;
?>
]">
<?php
if (isset($userRoles[$modName])) {
$userRole = $userRoles[$modName];
} else {
$userRole = current($roles);
}
foreach ($roles as $role) {
?>
<option value="<?php
echo $role['role_id'];
?>
" <?php
echo Str::selected($userRole['role_id'], $role['role_id']);
?>
><?php
echo $role['role_name'];
?>
(<?php
echo $role['role_desc'];
?>
)</option>
<?php
}
?>
</select>
</td>
</tr>
<?php
示例10:
</td></tr>
<?php
}
?>
<tr><td><b>審核狀態:</b></td><td>
<select name="status" >
<option value="0" <?php
echo Str::selected('0', $rows['status']);
?>
> 未審</option>
<option value="1" <?php
echo Str::selected('1', $rows['status']);
?>
> 已審</option>
<option value="2" <?php
echo Str::selected('2', $rows['status']);
?>
> 每月係統扣分</option>
</select>
</td></tr>
<tr><td><b>任務描述:</b></td><td><textarea cols="100" rows="5" name="description"><?php
echo $rows['description'];
?>
</textarea></td></tr>
<tr><td><b>審核評語:</b></td><td><textarea cols="100" rows="5" name="audite_memo"><?php
echo $rows['audite_memo'];
?>
</textarea></td></tr>
<tr><td colspan="2"><input type="submit" value="提交" class="button"> <input type="reset" value="重置" class="button"> <input type="button" onclick="javascript:history.back()" value="返回" class="button"></td></tr>
示例11: foreach
<legend>查詢</legend>
用戶名: <input type="text" name="username" size="20" value="<?php
echo $username;
?>
" />
會員組 :
<select name="rank">
<option value="-1" >全部</option>
<?php
foreach ($group as $item) {
?>
<option value="<?php
echo $item['id'];
?>
" <?php
echo Str::selected($rank, $item['id']);
?>
> <?php
echo $item['group_name'];
?>
</option>
<?php
}
?>
</select>
排序:<select name="order_by">
<option value="tot_flow" <?php
if ($order_by == 'tot_flow') {
echo ' selected="1" ';
}
?>
示例12:
echo Str::selected($type, 2);
?>
>照片名</option>
</select>
<input type="text" value="<?php
echo $keyword;
?>
" class="border" style="width:100px;" name="keyword" />
排序:
<select name="order_by" >
<option value="DESC" <?php
echo Str::selected($order_by, 'DESC');
?>
>越晚上傳越靠前</option>
<option value="ASC" <?php
echo Str::selected($order_by, 'ASC');
?>
>越早上傳越靠前</option>
</select>
<input type="hidden" value="<?php
echo $cate_id;
?>
" name="cate_id" />
</td>
<td>
<input type="submit" value="" class="search_true"/>
</form>
</td>
</tr>