fork(1) download
  1. <?php
  2. $str = file_get_contents('https://www.google.com/finance?q=USDEUR');
  3.  
  4. $stringOfRate = array();
  5. $regexp = '/1\\s([A-Z]{3})\\s[=]\\s([0-9]+)[.]([0-9]+)/ui';
  6. preg_match($regexp, $str, $stringOfRate);
  7.  
  8. var_dump($stringOfRate);
Success #stdin #stdout #stderr 0.01s 20640KB
stdin
Standard input is empty
stdout
array(0) {
}
stderr
PHP Warning:  file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/QLUZj2/prog.php on line 3
PHP Warning:  file_get_contents(https://www.google.com/finance?q=USDEUR): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/QLUZj2/prog.php on line 3