All pastes #771972 Raw Edit

Something

public text v1 · immutable
·published 2007-11-13 12:51 UTC
rendered paste body
function rsnews() {
	$html = file_get_contents("http://news.runescape.com/list.ws");
	$html = str_replace("\n", "", $html);
	preg_match_all("/<td valign=\"top\" style=\"color:black;\">(.*?)<\/td><td valign=\"top\">(.*?)<\/td><td align=\"right\" valign=\"top\" style=\"color:black;\">(.*?)<\/td>/", $html, $matches);
	for ($x = 0; $x < count($matches[1]);$x++) {
		$return[$x]['category'] = trim(strip_tags(str_replace("&nbsp;", "", $matches[1][$x])));
		$return[$x]['title'] = trim(strip_tags($matches[2][$x]));
		$return[$x]['date'] = trim(strip_tags($matches[3][$x]));
	}
	return $return;
}