你怎麼能在PHP回聲HTML和PHP代碼
<a href='/<?=$value["content_url"];?>' class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true"><?=$value["content_title"];?><span class="caret"></span></a>
添加這行代碼,以便最終你得到的東西是這樣的:
if (1 == 1) {
echo "<a href='/<?=$value["content_url"];?>'
class="dropdown-toggle" data-toggle="dropdown" role="button"
aria-haspopup="true" aria-expanded="true"> <?=$value["content_title"];?>
<span class="caret"></span></a>";
} else {
echo "Nothing to see!"
}
因爲你有多個標點符號將結束回聲快速..
謝謝!這對我有效。不知道你可以刪除變量中的標點符號。 – Jeroen