PHP.net releases /images/news/php-logo.gif Webmaster http://php.net/contact php-webmaster@lists.php.net http://php.net/releases/index.php XML; ob_start(); // Flatten major versions out of RELEASES. $RELEASED_VERSIONS = array_reduce($RELEASES, 'array_merge', []); $FEED_UPDATED = 0; krsort($RELEASED_VERSIONS); foreach ($RELEASED_VERSIONS as $version => $release) { $published = date(DATE_ATOM, strtotime($release["source"][0]["date"])); if ($release["announcement"]) { $id = "http://php.net/releases/" . str_replace(".", "_", $version) . ".php"; } else { $id = "http://qa.php.net/#$version"; } echo << PHP {$version} released! {$id} {$version} {$published} There is a new PHP release in town! XML; $maxtime = []; foreach ($release["source"] as $source) { if (!isset($source["date"])) { continue; } $maxtime[] = $time = strtotime($source["date"]); $released = date(DATE_ATOM, $time); echo " \n"; foreach (['md5', 'sha256'] as $hashAlgo) { if (isset($source[$hashAlgo])) { echo " {$source[$hashAlgo]}\n"; } } echo <<{$released} XML; } $updated = date(DATE_ATOM, max($maxtime)); if (isset($release['tags'])) { foreach ($release['tags'] as $tag) { echo ' ', htmlspecialchars($tag), "\n"; } } echo <<{$updated} XML; $FEED_UPDATED = max($maxtime, $FEED_UPDATED); } $entries = ob_get_clean(); $FEED_UPDATED = date(DATE_ATOM, max($FEED_UPDATED)); echo " {$FEED_UPDATED}\n"; echo $entries; echo "";