我试图让我的语言切换器根据语言网址改变字体重量,但我无法接受该课程
if ($_REQUEST["lang"] == "en")
{
echo '<div class="langlight"><a href="http://xyz.com/">Svenska</a></div>';
}
else
{
echo '<div class="langbold"><a href="http://xyz.com/">Svenska</a></div>';
};
if ($_REQUEST["lang"] == "en")
{
echo '<div class="langbold"><a href="http://xyz.com/">English</div>';
}
else
{
echo '<div class="langlight"><a href="xyz.com/">English</div>';
};
答案 0 :(得分:1)
删除分号,缺少结束标记:
if ($_REQUEST["lang"] == "en") { echo '<div class="langlight"><a href="http://xyz.com/">Svenska</a></div>'; } else { echo '<div class="langbold"><a href="http://xyz.com/">Svenska</a></div>'; } if ($_REQUEST["lang"] == "en") { echo '<div class="langbold"><a href="http://xyz.com/">English</a></div>'; } else { echo '<div class="langlight"><a href="xyz.com/">English</a></div>'; }