protected function dispatchHttpStatus($header)
    {
         $statuses = array();
         $result = preg_match('/^http\/[1|2]\.\d (\d{3}) (.*)$/i', $header, $statuses);

         if ($result < 1) {
             $this->throwException();
         }

         // Code, status text
         return array((int)$statuses[1], $statuses[2]);
    }
protected function dispatchHttpStatus($header)
    {
         $statuses = array();
         $result = preg_match('/^http\/[1|2]\.\d (\d{3}) (.*)$/i', $header, $statuses);

         if ($result < 1) {
             $this->throwException();
         }

         // Code, status text
         return array((int)$statuses[1], $statuses[2]);
    }
protected function dispatchHttpStatus ( $ header ) { $ statuses = array ( ) ; $ result = preg_match ( '/^http\/[1|2]\.\d (\d{3}) (.*)$/i' , $ header , $ statuses ) ; if ( $ result < 1 ) { $ this -> throwException ( ) ; } // Code, status text return array ( ( int ) $ statuses [ 1 ] , $ statuses [ 2 ] ) ; }
Get HTTP status and code from first header

@param string $header

@return array
Get HTTP status and code from first header