- file_get_contents: documentation ( source)
- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
- strip_tags: documentation ( source)
- explode: documentation ( source)
<?php
function getBTCValue() {
$url = 'http://middlecoin.com';
$contents = file_get_contents($url);
preg_match_all('/<td>(.*?)<\/td>/s', $contents, $matches);
$ex = explode(" ", strip_tags($matches[0][0]));
$output .= "<span style='color:red; font-weight:bold;'>Balance:</span> ".$matches[0][5]."<br>";
$output .= "<span style='color:#3399ff; font-weight:bold;'>Unexchanged:</span> ".$matches[0][4]."<br>";
$output = "<span style='color:#51d051; font-weight:bold;'>Immature:</span> ".$matches[0][3]."<br>";
$output .= "<span style='color:#000000; font-weight:bold;'>Paid:</span> ".$matches[0][6]."<br>";
return $output;
}
var_dump(getBTCValue());