简体   繁体   中英

If else won't accept class

Im trying to make my language switcher change font weight depending on the language url but i cannot get it to accept the class

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>';
};

Remove semicolons, missing closing tags:

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>';
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM