Why not replace all of this:
$everything = preg_replace("#\n#","",$everything[2]);
$everything = preg_replace("#\r#","",$everything);
$everything = preg_replace("#[\s]*<#","<",$everything);
preg_match('#<td class=\"normal\">([0-9]{1,9}\.[0-9]{1,9}\.[0-9]{1,9})</td>#s', $everything, $version);
with this:
preg_match('#<td class=\"normal\">\s*([0-9]{1,9}\.[0-9]{1,9}\.[0-9]{1,9})\s*</td>#s', $everything, $version);
Even if you did want to strip all line breaks, you don't have to strip \r and \n in two separate calls to preg_replace. Furthermore, you don't even need to strip them at all, as they are included in \s.