PHP error checking
<p>how would you go about doing something like that?</p>

<pre><code>#do something that may cause an $error
if (!$error) {
    #do something that may cause an $error
    if (!$error) {
        #do something that may cause an $error
        if (!$error) {
            #do something that may cause an $error
            if (!$error) {
            }
        }
    }

}

if ($error) {
    #error message
}
</code></pre>

<p>I'd say that's a better solution:</p>

<pre><code>#do something that may cause an $error
if ($error) goto error;
#do something that may cause an $error
if ($error) goto error;
#do something that may cause an $error
if ($error) goto error;
#do something that may cause an $error
if ($error) goto error;

error:
if ($error) {
    #error message
}
</code></pre>

<p>any other ideas?</p>
