亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

html_options関數(shù)

この関數(shù)は、どの要素が選択されるかを指定できます。値と出力屬性を指定するか、オプションの置換を指定する必要があります。

If 指定された要素value は配列であり、OPTGROUP 処理として使用され、再帰をサポートします。すべての出力は XHTML と互換性があります。

オプションの屬性名が指定されている場合、オプション リストは次の場所に配置されます。 <選択 name="groupname"></select> タグの配置。指定しない場合は、オプションのリストのみが生成されます。

上の表に記載されていないその他のパラメータは、 <select> ; 「名前/屬性」のペアとしてタグ內(nèi)に表示されます。オプションの屬性名が指定されていない場合 これらのパラメータは無視されます。

eg1:

test.php:

require( 'Smarty.class.php');
$smarty = 新しい Smarty;
$smarty->assign('cust_ids', array(1000,1001,1002,1003));
$smarty- >assign('cust_names', array('Joe Schmoe','Jack Smith','Jane
Johnson','Carlie Brown'));
$smarty->assign('customer_id', 1001 );
$smarty->display('test.html');

test.html:

<名前を選択=customer_id>
{html_options 値=$cust_ids selected=$customer_id 出力=$cust_names}
</select>




例 2:

test.php:
require('Smarty.class.php');
$smarty = 新しい Smarty;
$smarty->assign(' cust_options', array(
1001 => 'ジョー?シュモー',
1002 => 'ジャック?スミス',
1003 => 'ジェーン?ジョンソン',
1004 => 'チャーリーBrown'));
$smarty->assign('customer_id', 1001);
$smarty->display('test.html');

テスト。 html:
<select name=customer_id>
{html_options options=$cust_options selected=$customer_id}
</select>


出力:
<select name=customer_id>
<option value="1000">Joe Schmoe</option>
<option value="1001" selected="selected"> ;ジャック スミス</option>
<option value="1002">ジェーン ジョンソン</option>
<option value="1003">チャーリー ブラウン</option>
< /select>

微信圖片_20180313114508.png#

學(xué)び続ける
||
<?php echo "html_options函數(shù)";