Dollar

From S23Wiki
Jump to: navigation, search

<HighlightSyntax> <?php

  1. Dollarwert in Euro, von xe.com -- mutante

function dollar_euro() { $buffer=file_get_contents("http://www.xe.com/"); $pieces=explode("1 EUR =",$buffer); $pieces=explode("<td align=\"center\" class=\"cur2 currencyA\">",$pieces[1]); $pieces=explode("</td>",$pieces[1]); return $pieces[0]; } echo "Der Dollar kostet heute ".dollar_euro()." Euro.\n"; ?> </HighlightSyntax>

edgar@cgn:~$ php dollar.php
Der Dollar kostet heute 1.42784 Euro.