我在osclass中有功能..
function item_city_area($cityarea_txt, $cityarea_select_txt) {
$aCityArea = osc_get_cityarea() ;
$item = (osc_item() != null) ? osc_item() : array() ;
switch( count($aCityArea) ) {
case 0: // 0 regions ?>
<div class="clearfix">
<label><?php echo $cityarea_txt ; ?></label>
<div class="input">
<input class="city_name" id="city_name" type="text" name="city" value="<?php echo get_city_name($item) ; ?>" />
</div>
</div>
<?php
break;
case 1: ?>
<input class="city_id" id="city_id" type="hidden" name="cityId" value="<?php echo get_city_id($item) ; ?>" />
<?php
break;
default: // more than one region ?>
<div class="clearfix">
<label><?php echo …Run Code Online (Sandbox Code Playgroud) osclass ×1