我正在通過國家特定的代碼過濾我的網站上的一些內容,我試圖添加其他語句,因此它不必將每件作爲單獨的代碼運行,除非我嘗試給出錯誤:PHP意外elseif
<?php if (function_exists('isCountryInFilter')) { ?>
<?php if(isCountryInFilter(array("us", "ca"))) { ?>
<a rel="nofollow" class='preloading gallery_image' href="#" target="_blank">
<?php } ?>
<?php elseif(isCountryInFilter(array("au"))) { ?>
<a rel="nofollow" class='preloading gallery_image' href="#" target="_blank">
<?php } ?>
<?php else(isCountryInFilter(array("nz"))) { ?>
<a rel="nofollow" class='preloading gallery_image' href="#" target="_blank">
<?php }} ?>
上面提供了以下錯誤:Parse error: syntax error, unexpected T_ELSEIF in
,指的是第一ELSEIF而不是格式的
你應該真的學會如何從你的視圖/輸出中分離邏輯。反正,檢查我的回答 – RobertPitt 2010-06-26 16:57:55