-7
有沒有一種方法,如果我計算for循環中的標籤數量,例如。PHP計數問題
if($tags == 0){
echo 'no tags entered.';
} else if($tags == 1){
echo $tags . 'tag entered';
} else {
echo $tags . 'tags entered';
}
這是我的代碼。
for ($x = 0; $x < count($tags); $x++){
if ($tags[$x] != '') {// get rid of empty tags
echo ' ' . strtolower(strip_tags($tags[$x])) . ',';
}//end of get rid of empty tags
}
你會得到什麼結果代碼? – 2010-08-09 21:49:02
@Eton B.哪個代碼? – Dis9 2010-08-09 21:49:54
一個簡單的如果一個標籤或標籤或輸入標籤:) – Dis9 2010-08-09 21:50:45