PHP Classes

File: test_yahooquotes

Recommend this page to a friend!
  Classes of Andreas Vollenklee   Yahoo Quotes   test_yahooquotes   Download  
File: test_yahooquotes
Role: Example script
Content type: text/plain
Description: script to test the functionality of class YahooQuotes
Class: Yahoo Quotes
Retrieve stock quotes from Yahoo Finance
Author: By
Last change:
Date: 15 years ago
Size: 860 bytes


Class file image Download

This script is for testing the php- class YahooQuotes
It tries to receive historical and intraday prices of stocks
from If an error occures it echoes an

Please check with Yahoo, Inc. if you may use these scripts
for your purpose.

require ("yahooquotes.php");

$symbols = array("MSFT", "BMW.DE", "NOSUCHSYMBOL");
$from = array (2008, 7, 25); //25th July 2008
$to = array (2008, 8, 1); //1st August 2008

echo "Quotes are accessed from\n";

foreach (
$symbols as $sym) {
$quotes = new YahooQuotes ($sym, $from, $to);
    if (
$quotes->getHistQuotes()) {
        if (
$quotes->getTodayQuotes()) {
        } else {
    } else {