[Solved] How to combine php and javascript to get an array to ticker tape


example : http://testenvansoftware.nl/test12/index3.php

I see, ->getData() is NOT part of php.net functions… right?

it is part of class.stockMarketAPI2.php

ok, yes it is, i see now:

public function getData($symbol="", $stat="") {

        if (is_array($this->symbol)) {
            $symbol = implode("+", $this->symbol); //The Yahoo! API will     take multiple symbols
        }

        if($symbol) $this->_setParam('symbol', $symbol);
        if($stat) $this->_setParam('stat', $stat);

        $data = $this->_request();

       if(!$this->history) {
        if ($this->stat === 'all') { 
            foreach ($data as $item) {

                //Add to $return[$symbol] array. Indice 23 is the symbol.
                $return[$item[23]] = array(
                    'name'                      =>      strip_tags($item[20]),
                    'price'                       =>      strip_tags($item[0]),
                    'change'                      =>      strip_tags($item[1]),
                    'volume'                      =>      strip_tags($item[2])

                    //'avg_daily_volume'            =>  strip_tags($item[3]),
                    //'stock_exchange'              =>  strip_tags($item[4]),
                    //'market_cap'                  =>  strip_tags($item[5]),
                    //'book_value'                  =>  strip_tags($item[6]),
                    //'ebitda'                      =>  strip_tags($item[7]),
                    //'dividend_per_share'          =>  strip_tags($item[8]),
                    //'dividend_yield'              =>  strip_tags($item[9]),
                    //'earnings_per_share'          =>  strip_tags($item[10]),
                    //'fiftytwo_week_high'          =>  strip_tags($item[11]),
                    //'fiftytwo_week_low'           =>  strip_tags($item[12]),
                    //'fiftyday_moving_avg'         =>  strip_tags($item[13]),
                    //'twohundredday_moving_avg'    =>  strip_tags($item[14]),
                    //'price_earnings_ratio'        =>  strip_tags($item[15]),
                    //'price_earnings_growth_ratio' =>  strip_tags($item[16]),
                    //'price_sales_ratio'           =>  strip_tags($item[17]),
                    //'price_book_ratio'            =>  strip_tags($item[18]),
                    //'short_ratio'                 =>  strip_tags($item[19]),
                    //'name'                        =>  strip_tags($item[20])
                );
            }
        } else {
            foreach ($data as $item)
                $return[] = array($this->stat => $item);
        }
    } elseif(is_array($this->history)) {
        $return = $data;
    }

    return $return;
}

1

solved How to combine php and javascript to get an array to ticker tape