Hi everyone,

So, I'm new in PHP. I know that PHP is basically inline codes. However, from what I've seen, (and from experiences with ASP classic), sometimes coders would rather write all the functions before any of the html elements. And in the inline codes, they'll call the functions/variables.

e.g.

<?php $var = 'test'
.... codes codes functions functions...
?>
<div>
<?php echo $var ?>
</div>

or..

<div>
<?php echo 'test' ?>
</div>

which one is the better style?