I have this super simple function
function getstockstats($stocksymbol)
{
include_once('ii-prediction-log-widget/class.yahoostock.php');
$objYahooStock = new YahooStock;
$objYahooStock->addFormat("snl1d1t1cvc1p2");
$objYahooStock->addStock("$stocksymbol");
foreach( $objYahooStock->getQuotes() as $code => $stock)
{
echo $stock[0];
}
}
when I use the function, I pass it a symbol like this
getstockstats("aapl");
I want this line
$objYahooStock->addStock("$stocksymbol");
to receive the variable (aapl), instead, its reading it as $stocksymbol
I know there is a way to exit that but I can't for the life of me figure it out because it is so hard to explain that portion. Can someone help me?
I've tried wrapping it in {}
like this
$objYahooStock->addStock("{$stocksymbol}");
but that did not work either. Thank you!! <3