php - Adding an IF statement to not print a link if its URL is an empty string -


i have following code developer of wordpress site , if possible i'd make revision myself.

$list .= '<div class="fc_right">     <h3>'.$headline.'</h3>     <div class="fc_caption">'.$caption.'</div>     <a href="'.$url.'">more &#187;</a>   </div><div class="clear"></div> </li>'; 

i want add if statement in there if $url blank, don't print more>> link.

let me know if need provide more context of code, wanted keep brief if possible.

$list .= '<div class="fc_right">     <h3>'.$headline.'</h3>     <div class="fc_caption">'.$caption.'</div>' .     ($url == '' ? '' : '<a href="'.$url.'">more &#187;</a>') .   '</div><div class="clear"></div> </li>'; 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -