title: Get data from a multi dimensional in PHP?
body: <p>I have a private function </p>
  
  <pre><code>private $_CODES = array(
      301 =&gt; array(
          "code"=&gt; 301,
          "message"=&gt; "User With ID Not Found",
          "type"=&gt; "Error"
      ),
      302 =&gt; array(
          "code"=&gt; 302,
          "message"=&gt; "Email Id Not Valid",
          "type"=&gt; "Error"
      ),
  );
  </code></pre>
  
  <p>Accessing this function using a public function getError both function are in the same class.</p>
  
  <pre><code>public  function getError($code)
      {   
          return $this-&gt;_CODES[]=$code;
      }
  </code></pre>
  
  <p>I am getting the error code only, means 301 am not getting the exact message. while passing the parameter($code) need to get corresponding error message. what I was missed here? 
  i have called the error function like this</p>
  
  <pre><code>       echo json_encode(Errors::getError(301));
  </code></pre>