Question: I have been researching fgetcsv() and have the following working code:

```
$file = fopen($pathToCsv,"r");
$data = array();

while(! feof($file))
  {
      array_push($data, fgetcsv($file));
  }

fclose($file);

```

However, when I try to adapt this to dynamically accept an unknown number of csv files stored into an array, things cease to work:

```
$year = $_POST['year'];
$m = "maths".$year;
$sheets = $$m; //an array containing between 5 an 8 paths to csv and other info
$data = array();

function ArrayFromCsv($file, $i) {
    while(! feof($file))
    {
        array_push($data[$i], fgetcsv($file)); //line 15
    } 
    fclose($file);
}

for ($i = 0; $i < count($$m); $i++){
    array_push($data, array());
    $x = fopen($sheets[$i]['csv'],'r');
    ArrayFromCsv($x, $i);
}

```

I get: `Warning: array_push() expects parameter 1 to be array, null given in ... on line 15` 

I'm not how to research this further. Is there a better way or obvious mistake? I've tried a number of methods.

Answer: 
I found the answer, in the Twitter app settings, the following option was ticked. So, I untucked it and it is now working 

```
Enable Callback Locking (It is recommended to enable callback locking to ensure apps cannot overwrite the callback url)

```
you need to set Callback URL in <https://apps.twitter.com/app/xxxxxx/settings>  
for example, <https://auth.firebase.com/v2/xxxxxxx/auth/twitter/callback>