PHP errors for (isset) variables and optimization
<p>My error logs get huge quick because I reference a ton of variables with may or may not exist. I have been going back through and starting to clean them up but wanted to see if there was a more effective (and cleaner) way of checking for php variables. </p>

<p>Currently I use as the following:</p>

<p>Example 1:</p>

<pre><code>&lt;?php
     if (isset($_SESSION['checked']) &amp;&amp; $_SESSION['checked'] == "Y") {
        do something;
     }
?&gt;
</code></pre>

<p>Example 2:
(within html form)</p>

<pre><code>&lt;input type="text" name="sample_number" onKeyUp="this.value=this.value.replace(/[^0-9]/ig, '')" value="&lt;?php echo $fields['sample_number']; ?&gt;" /&gt;
</code></pre>

<p>where sample number is displayed if it is set.</p>

<p>is there a better way to handle scenarios like these?</p>
