])/', '', $url)); $next = true; break; } } } /* Example JSON data: https://api.github.com/repos/rss-bridge/rss-bridge/contributors */ // We want contributors sorted by name usort($contributors, function($a, $b){ return strcasecmp($a->login, $b->login); }); // Export as Markdown list foreach($contributors as $contributor) { echo " * [{$contributor->login}]({$contributor->html_url})\n"; } /** * Parses the provided response header into an associative array * * Based on https://stackoverflow.com/a/18682872 */ function parseResponseHeader($header) { $headers = array(); $requests = explode("\r\n\r\n", trim($header)); foreach ($requests as $request) { $header = array(); foreach (explode("\r\n", $request) as $i => $line) { if($i === 0) { $header['http_code'] = $line; } else { list ($key, $value) = explode(': ', $line); $header[$key] = $value; } } $headers[] = $header; } return $headers; }