I have this function that calls up a text list of $symbols, puts the text into a URL, which then requests some CSV data. Right now, the data is being stored in this format:
$symbol[0], $symbol[1], $symbol[3], etc
I need to change it so that instead of naming the arrays $symbol, I need some sort of number such as $0001, then $0002. Each one of these will still need to contain the CSV data (such as $0001[0], $0001[1], etc). How can I do this?
Here is what I now, using $symbol as the array name:
<?php
foreach($symbol as $sym){
$fp=fopen("http://www.a.com/d.csv?s={$symbol}&f=sl1=.csv","r");
${$symbol} = fgetcsv ($fp, 10000, ",");
fclose ($fp);
}
?>
How can I replace ${$symbol} with some sort of numerical value that counts up as it goes through the foreach (0000,0001,0002, etc)?