$url = 'the web address I want to get the first and second numbers close to $' ;
$str = file_get_contents($url);
preg_match_all('/ ([$]) *(\d+(:?.\d+)?)/', $str, $matches, PREG_SET_ORDER);
$i=0;
foreach ($matches as $val) {
if($i==0) $first=$val[2] ;
if($i==3) $second=$val[2] ;
$i++;
}
$bad_symbols = array(",", "."); $first = str_replace($bad_symbols, "", $first);
$bad_symbols = array(",", "."); $second = str_replace($bad_symbols, "", $second);
echo $first . "</br>";
echo $second;
it worked fine till yesterday what could be the problem?