我有一個名單的列表,我想他們在這樣的2列。 如果第一列繼續在第二列,我想顯示第一個字母和這(繼續...)。列出2列
# C (continued...)
1 Congo
2 Cook Islands
3 Costa Rica
5 Cote D'Ivoire
6 Croatia
A D
Afghanistan Denmark
Africa Djibouti
Albania Dominica
Algeria
American Samoa
B
Bahamas, The
Bahrain
Bangladesh
Barbados
Bouvet Island
Brazil
Bulgaria
C
Cambodia
Cameroon
Canada
Cape Verde
Caribbean
Chad
Chile
China
Christmas Island
Colombia
Comoros
這是代碼現在,但它不顯示Ç(續)第二列
$alphabet = null;
while($row1 = mysql_fetch_array($locals)) {
if($alphabet != substs($row1['RSTOWN'],0,1)) {
echo strtoupper(substr($row1['RSTOWN'],0,1));
$alphabet = substr($row1['RSTOWN'],0,1);
}
echo '<li class="forward">
<a href="townpubs.php?RSTOWN='.$row1['RSTOWN'].'" rel="external">'
.$row1['RSTOWN'].
'<small class="listcounter">'.$row1['PubCount'].'</small>
</a>
</li>';
爲什麼有捷克缺少什麼? :-)好吧,嚴重的是,我懷疑這是一個問題......如果你是程序員,爲什麼你只是不做你想要的程序?問題在哪裏? – TMS