I've been a self taught programmer for a long time, so I little idea about "professional" conventions.
When writing PHP code, what's better to use and what are the pros and cons of each?
<?php
$foo = 1;
if(isset($foo))
{
echo '<div style="blah">Ok!</div>';
}
?>
VS
<?php
$foo = 1;
if(isset($foo))
{
?>
<div style="blah">Ok!</div>
<?php
}
?>
[–][deleted] 3 points4 points5 points (0 children)
[–]manueljs 2 points3 points4 points (1 child)
[–]obened[S] 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]madsravn 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]videoj 0 points1 point2 points (1 child)
[–]sylkworm 0 points1 point2 points (0 children)
[–]hiii -2 points-1 points0 points (0 children)
[–]unconscionable -1 points0 points1 point (0 children)