I am making this script to help parse data out of alot of tables, basically the script will look at an account on a popular TS website ad parse the server port out of the table. However, the script keeps saying 1 and doing nothing else, can someone help me figure out what is going on here?
$server_regex = '(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5}\b)';
function sort_ts($num){
global $server_regex;
$conn = file_get_contents("http://www.tsviewer.com/index.php?page=ts_viewer&ID=$num");
$matched = preg_match($server_regex, $conn);
if($matched){
$matched = explode(':',$conn);
echo "Server $parts[0] Port $parts[1] <br>";
}
}
sort_ts($_GET['x']);
?>