[0] => jamesRUS52\TinkoffInvest\TIInstrument Object
(
[figi] => BBG000HLJ7M4
[ticker] => IDCC
[isin] => US45867G1013
[minPriceIncrement] => 0.01
[lot] => 1
[currency] => USD
[name] => InterDigital
[type] => Stock
)
Array
(
[0] => jamesRUS52\TinkoffInvest\TIInstrument Object
(
[figi:jamesRUS52\TinkoffInvest\TIInstrument:private] => BBG000HLJ7M4
[ticker:jamesRUS52\TinkoffInvest\TIInstrument:private] => IDCC
[isin:jamesRUS52\TinkoffInvest\TIInstrument:private] => US45867G1013
[minPriceIncrement:jamesRUS52\TinkoffInvest\TIInstrument:private] => 0.01
[lot:jamesRUS52\TinkoffInvest\TIInstrument:private] => 1
[currency:jamesRUS52\TinkoffInvest\TIInstrument:private] => USD
[name:jamesRUS52\TinkoffInvest\TIInstrument:private] => InterDigital
[type:jamesRUS52\TinkoffInvest\TIInstrument:private] => Stock
)
var_dump($stockes[0]);
: array(8) { ["figi"]=> string(12) "BBG000HLJ7M4" ["ticker"]=> string(4) "IDCC" ["isin"]=> string(12) "US45867G1013" ["minPriceIncrement"]=> string(4) "0.01" ["lot"]=> string(1) "1" ["currency"]=> string(3) "USD" ["name"]=> string(12) "InterDigital" ["type"]=> string(5) "Stock" }
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
require_once 'vendor/autoload.php';
require_once 'libs/functions.php';
use \jamesRUS52\TinkoffInvest\TIClient;
use \jamesRUS52\TinkoffInvest\TISiteEnum;
use \jamesRUS52\TinkoffInvest\TICurrencyEnum;
use \jamesRUS52\TinkoffInvest\TIInstrument;
use \jamesRUS52\TinkoffInvest\TIPortfolio;
use \jamesRUS52\TinkoffInvest\TIOperationEnum;
use \jamesRUS52\TinkoffInvest\TIIntervalEnum;
use \jamesRUS52\TinkoffInvest\TICandleIntervalEnum;
use \jamesRUS52\TinkoffInvest\TICandle;
use \jamesRUS52\TinkoffInvest\TIOrderBook;
use \jamesRUS52\TinkoffInvest\TIInstrumentInfo;
$token = 't.s81Ju6wc-xvZH9xI9g6HoDCgPPuigexF-JG206-Yoi0q_ykw4OICLcNkIdK1hNGK2miglR21QWOHyPdQLNEyBA';
$tinkoff = 'https://api-invest.tinkoff.ru/openapi';
try {
$client = new TIClient($token,TISiteEnum::SANDBOX);
$stockes = $client->getStocks();
$stockes = clean($stockes);
vd($stockes);
} catch (Exception $e) {
vd($e);
}
function vd($var){
$var = print_r($var, true);
echo "<pre>{$var}</pre>";
}
function clean($stockes){
$clean = [];
foreach ($stockes as $int => $item) {
$array = (array)$stockes[(int)$int];
$object = [];
foreach ($array as $key => $val) {
$key = (string)str_replace('jamesRUS52\TinkoffInvest\TIInstrument', '', (string)$key);
$val = (string)$val;
$object[(string)$key] = (string)$val;
}
$clean[(int)$int] = (array)$object;
unset($object);
}
return (array)$clean;
}
Проверьте, может у некоторых элементов массива вовсе и нет свойства currency))
if(isset($stockes[0]["figi"])) var_dump($stockes[0]["figi"]);
if(isset($stockes[0]["currency"])) var_dump($stockes[0]["currency"]);
$css = file_get_contents("css/{$file}");
$css = preg_replace('/\/\*(...)\*\//', '', $css);
vd($css);
./php/php ./php_script/index.php
#-------------------------------------------------
#
# Project created by QtCreator 2015-12-18T20:10:57
#
#-------------------------------------------------
QT += core gui webkit webkitwidgets
QT += widgets
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = QWebViewExample
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui