Arrays inside a PHP function
<p>I'm trying to access an arrays data from inside a function but keep getting the error: Undefined varaible: status. Any idea how to correct this?</p>

<pre><code>&lt;?php

$state = 'New York';

function state_values($state){
    switch ($state) {
        case 'New York':
            echo "State is $state";
            $status = array("abbr" =&gt; "NY", "code" =&gt; "03");
            return $status;
            break;
        case 'California':
            echo "State is $state";
            $status = array("abbr" =&gt; "CA", "code" =&gt; "06");
            return $status;
            break;
        case 'Washington':
            echo "State is $state";
            $status = array("abbr" =&gt; "WA", "code" =&gt; "05");
            return $status;
            break;
    }
}

# Call the function
state_values($state);


echo $status['abbr'];
echo $status['code'];


?&gt;
</code></pre>
