2016-04-24 10 views
0

Ich versuche, den gesamten USD Wert einer Bitcoin Wallet von Blockchain mit cURL zu greifen. Hier ist mein Code:Extrahieren von Daten aus Blockchain mit PHP curl

$content2 = file_get_contents("https://blockchain.info/address/1HoB5A1HBbnB3b5gQZ6U78JzA7Hqk9WWYx?currency=USD"); 

preg_match('#<span data-c="([0-9\.]*)">$ ([0-9\.]*)</span>#Uis', $content2, $USDmatch); 

$usd = $USDmatch[0]; 

echo "Total USD: $usd"; 
+1

Mögliche Duplikat [Wie analysieren Sie und Prozess HTML/XML in PHP?] (Http://stackoverflow.com/questions/3577641/how-do-you-parse-and-process-html- xml-in-php) –

Antwort

0

Sie müssen Backslash verwenden, um das Dollarzeichen zu entkommen.

preg_match('#<span data-c="([0-9\.]*)">\$ ([0-9\.]*)</span>#Uis', $content2, $USDmatch); 
+0

Danke !!! <3 – joeytrumann