if explodable / else
<p>I have a string which may or may not contain commas. If it does, I want it exploded into an array; if it doesn't, I still want the string saved to the new identifier. My code clearly doesn't work. Anyone have any better ideas?</p>

<pre><code>if(explode(",", $_SESSION['shoparea']))
{
    $areas = explode(",", $_SESSION['shoparea']);
} else {
     $areas = $_SESSION['shoparea'];
}
</code></pre>

<p>What is the correct syntax for this operation?</p>
