how about this:
$mtg_url='http://mtgox.com/code/data/ticker.php';
$handle = fopen ($mtg_url, "r");
$output = fread($handle, 1024);
fclose($handle);
$obj = json_decode($output);
$bid = $obj->ticker->buy;
$ask = $obj->ticker->sell;
echo "bid: ".$bid." | ask: ".$ask;
If you're on an IIS server and opt to use the https protocol, the server will close the connection without sending close_notify, and PHP will report an error of "SSL: Fatal Protocol Error" ... for those of you on IIS
please use file_get_contents or the cURL library.