I have a function called ReadOldPriceList() that reads in a flat text file
of stock prices and puts them into an array called $iOldPrices.
Inside my function, I have declared my array as follows
function ReadOldPriceList()
{
global $iOldPrices;
$iOldPrices = array();
.....
}
and assign it values after I parse the flat text file.
I've tested my array inside my function and I'm getting
the values put properly into the array.
But what I need to do is access this array later on
in my script and when I try to print out the values later
on to test it, it's empty.
for ($iCount = 0; $iCount < count($iOldPrices); $iCount++)
{
print "$iOldPrices[$iCount]";
}
Can someone please let me know what I've done wrong.
of stock prices and puts them into an array called $iOldPrices.
Inside my function, I have declared my array as follows
function ReadOldPriceList()
{
global $iOldPrices;
$iOldPrices = array();
.....
}
and assign it values after I parse the flat text file.
I've tested my array inside my function and I'm getting
the values put properly into the array.
But what I need to do is access this array later on
in my script and when I try to print out the values later
on to test it, it's empty.
for ($iCount = 0; $iCount < count($iOldPrices); $iCount++)
{
print "$iOldPrices[$iCount]";
}
Can someone please let me know what I've done wrong.