Insert PHP into Echo -
Insert PHP into Echo -
i trying insert below php echo having problem right formatting.
php:
<?php if ( isset($heroloc) ) { echo '@ '.$heroloc;} ?> would place if statement below right after $created_time
echo '<span class="time">'.$created_time.'</span>'; somethign this, formatted properly:
echo '<span class="time">'.$created_time. if ( isset($heroloc) ) { echo '@ '.$heroloc;'</span>';
use ternary operator
<?php echo '<span class="time">'.$created_time.(isset($heroloc) ? '@ '.$heroloc : '').'</span>'; php
Comments
Post a Comment