Check if std Class element exists
<p>I have the following code:</p>

<pre><code>            $UIDInfo = users::getUserInfo($UID);
        print_r($UIDInfo);

        if(property_exists('castleName', $UIDInfo)){
            die('UIP Member');
        } elseif(!property_exists('castleName', $UIDInfo)){
                die('Not UIP member');
        }
</code></pre>

<p>I want to do a check to see if there is an element [castleName] but my code is not working.  How can I check if that [castleName] exists.  From the same query that element will not be returned if the user is not a member.</p>

<p>The print_r returns this:</p>

<pre><code>Array ( 
    [0] =&gt; stdClass Object ( 
        [uID] =&gt; 1 
        [username] =&gt; wdeswardt 
        [memRequestID] =&gt; 1 
        [castleName] =&gt; WilliamNZ 
        [emailAddress] =&gt; the users email address 
    ) 
) 
</code></pre>

<p>Not UIP member</p>