UrbanTwitch
09-06-2009, 05:51 AM
Hi there, does this seem right?
<?php
$file = file_get_contents("http://minecraft.net");
preg_match("/<div id=\"links\">(.*?)<br\/>/", $file, $post);
echo "MC Stats: $post[0] <br />";
?>
Doesn't work... I get the error:
Notice: Undefined offset: 0 in C:\wamp\www\crafthub\stats\stats.php on line 8
MC Stats:
Ok now go to: http://minecraft.net. Then view source and go to <div id="links"> etc... Well, how do I grab that? I am doing it wrong (hence the error). Can anyone help me?
Thanks.
<?php
$file = file_get_contents("http://minecraft.net");
preg_match("/<div id=\"links\">(.*?)<br\/>/", $file, $post);
echo "MC Stats: $post[0] <br />";
?>
Doesn't work... I get the error:
Notice: Undefined offset: 0 in C:\wamp\www\crafthub\stats\stats.php on line 8
MC Stats:
Ok now go to: http://minecraft.net. Then view source and go to <div id="links"> etc... Well, how do I grab that? I am doing it wrong (hence the error). Can anyone help me?
Thanks.