Defined error message in the PHP
<p>How do I "make" error messages in best practices? Right now I just have <code>$error = '';</code> and then just a lot of if(){}s that do <code>.= 'Message&lt;br&gt;'</code>, and then <code>if (!empty($error)) { echo $error; }</code>, which I assume is a terrible thing.</p>
