<?php function postimage($x1){?>
<?php if($image==''){ $first_img = $x2 ;if($first_img){;?>
<?php echo 'img';} else{ ;?>
<?php echo 'xxx';?>
<?php }};?>
<?php };?>
-----
<?php if ($foo) { ?>
html
<?php } else { ?>
html
<?php } ?>
-----
<?php if($first_condition): ?>
/*$first_condition is true*/
<?php elseif ($second_condition): ?>
/*$first_condition is false and $second_condition is true*/
<?php else: ?>
/*$first_condition and $second_condition are false*/
<?php endif; ?>test http://www.runphponline.com
https://stackoverflow.com/questions/4731810/if-else-embedding-inside-html