I am having a small trouble. I hope I am not outputing string properly.Here is the code
$icon = ( isset( $tab['icon'] ) && $tab['icon'] ) ?'<i class="$tab['icon']"</i>' : '';
I want to output this <i class="$tab['icon']"</i>
Thank you.
I am having a small trouble. I hope I am not outputing string properly.Here is the code
$icon = ( isset( $tab['icon'] ) && $tab['icon'] ) ?'<i class="$tab['icon']"</i>' : '';
I want to output this <i class="$tab['icon']"</i>
Thank you.
I am not very familiar with the shorthand if statement syntax so here is what I would do longhand. This is assuming $tab['icon']
needs to be set to the boolean True correct?
if(isset($tab['icon']) and $tab['icon']){
echo "<i class='{$tab[icon]}'>Here it is with a class!</i>";
}