-4
<?php
 mysql_query("SELECT * FROM page where page_id = '$page_id'") or die(mysql_error());

while($land = mysql_fetch_array($resultxx)){

$land =$land['land'];

?>

输出$landNL,DE,BE,AL.. 如何拆分输出

例子

<?php 
      echo "    
    <select> 
    <option value='NL'>NL</option>
    <option value='DE'>DE</option>
    <option value='BE'>BE</option>
    <option value='AL'>AL</option>
    </select>";

    }
    ?>
4

1 回答 1

0

尝试这个

<?php
 mysql_query("SELECT * FROM page where page_id = '$page_id'") or die(mysql_error());

while($land = mysql_fetch_array($resultxx)){

$land =$land['land'];
$landarray = explode(",",$land);
$count = count($landarray);
echo "<select>";
for($i=0;$i<$count;$i++){
echo '<option value='.$landarray[$i].'>'.$landarray[$i].'</option>';
}
echo "</select>";
}

?>
于 2013-08-29T13:44:08.087 回答