So, I asked a similar question before, and now I'm only more confused, so I will ask about it differently ...
What I'm trying to do is abstract my php and put the html bits used in my validator as error messages in functions that return html to where they are needed on the page.
What I have now:
<section>
<?php
if($errMsg)
{
errMsg();
}
?>
</section>
<?php
function errMsg()
{
?>
<section>
<p>O crap! There was an error</p>
</section>
<?php
}
?>
But in my previous question I was told that doing it this way is a "dirty hack", and it is better to use it in such situations. But to use return, I will need to assign all the returned html to var and to do this, I will need to put html in the string. I would prefer not to add more than two html lines to the line due to the pain in the butt of the number of quotes needed for this.
, heredoc, ob_start/ob_get_clean. .
1 , ?
2 , ? /
3 - ?: -\