Once I determine a var exist in PHP do I need to keep checking it in that page?
<p>I have a basic PHP question, take the code below for example, let's say I need to use this 10 times on a page, is there a better way to do it?</p>

<ul>
<li>I realize I could wrap it in a function and just keep calling that function but is there a better way then to keep on checking if the item is set and equals a a certain value.  After finding this out the first time is there some other way of remembering the result from the first time instead of doing it 10 different times?</li>
</ul>

<p>Hope that makes sense.</p>

<pre><code>&lt;?PHP
if (isset($_SESSION['auto_id']) &amp;&amp; $_SESSION['auto_id'] == "1") {
    //do something
}

// do other code here that breaks these up

if (isset($_SESSION['auto_id']) &amp;&amp; $_SESSION['auto_id'] == "1") {
    //do something else
}

// do other code here that breaks these up

if (isset($_SESSION['auto_id']) &amp;&amp; $_SESSION['auto_id'] == "1") {
    //do something else
}

// do other code here that breaks these up

if (isset($_SESSION['auto_id']) &amp;&amp; $_SESSION['auto_id'] == "1") {
    //do something else
}

...ect
</code></pre>

<p>?></p>
