private function getLinkHeaderAsArray($linkHeaderAsString)
    {
        $urls = array();

        if (preg_match_all('/<(.*?)>\s*;\s*rel="(.*?)"\s*/', $linkHeaderAsString, $matches)) {
            foreach ($matches[2] as $i => $relName) {
                $urls[$relName] = $matches[1][$i];
            }
        }

        return $urls;
    }
private function getLinkHeaderAsArray($linkHeaderAsString)
    {
        $urls = array();

        if (preg_match_all('/<(.*?)>\s*;\s*rel="(.*?)"\s*/', $linkHeaderAsString, $matches)) {
            foreach ($matches[2] as $i => $relName) {
                $urls[$relName] = $matches[1][$i];
            }
        }

        return $urls;
    }
private function getLinkHeaderAsArray ( $ linkHeaderAsString ) { $ urls = array ( ) ; if ( preg_match_all ( '/<(.*?)>\s*;\s*rel="(.*?)"\s*/' , $ linkHeaderAsString , $ matches ) ) { foreach ( $ matches [ 2 ] as $ i => $ relName ) { $ urls [ $ relName ] = $ matches [ 1 ] [ $ i ] ; } } return $ urls ; }
Extract all rel => URL pairs from the provided Link header value

Mailchimp only implements the URI reference and relation type from
RFC 5988, so the value of the header is something like this:

'https://us13.api.mailchimp.com/schema/3.0/Lists/Instance.json; rel="describedBy",
<https://us13.admin.mailchimp.com/lists/members/?id=XXXX>; rel="dashboard"'

@param string $linkHeaderAsString

@return array
Extract all rel = > URL pairs from the provided Link header value