Q: PHP: applying a "name" to the array using the php below I can successfully read my CSV file into an associative array, assigning "names"/values to the variable keys.
<?php

$filepath = "./CSV.csv";
$file = fopen($filepath, "r") or die("Error opening file");
$i = 0;

while(($line = fgetcsv($file)) !== FALSE) {
    if($i == 0) {
        $c = 0;
        foreach($line as $col) {
            $cols[$c] = $col;
            $c++;
        }
    } else if($i > 0) {
        $c = 0;
        foreach($line as $col) {
            $data[$i][$cols[$c]] = $col;
            $c++;
        }
    }
    $i++;
}

?>

THE CSV FILE CONTAINS:
name, street, town, state, zip, status
name 1, street 1, town 1, state 1, zip 1, status 1
name 2, street 2, town 2, state 2, zip 2, status 2
name 3, street 3, town 3, state 3, zip 3, status 3
name 4, street 4, town 4, state 4, zip 4, status 4
name 5, street 5, town 5, state 5, zip 5, status 5
THE OUTPUT OF THE PHP IS ACCORDINGLY:
Array
(
[1] => Array
    (
        [name] => name 1
        [street] => street 1
        [town] => town 1
        [state] => state 1
        [zip] => zip 1
        [status] => status 1
    )

[2] => Array
    (
        [name] => name 2
        [street] => street 2
        [town] => town 2
        [state] => state 2
        [zip] => zip 2
        [status] => status 2
    )

[3] => Array
    (
        [name] => name 3
        [street] => street 3
        [town] => town 3
        [state] => state 3
        [zip] => zip 3
        [status] => status 3
    )

[4] => Array
    (
        [name] => name 4
        [street] => street 4
        [town] => town 4
        [state] => state 4
        [zip] => zip 4
        [status] => status 4
    )

[5] => Array
    (
        [name] => name 5
        [street] => street 5
        [town] => town 5
        [state] => state 5
        [zip] => zip 5
        [status] => status 5
    )

)
=== end of output ===
QUESTION:
How could I assign a value to each array so that it does not deliver:
Array
(
[1] => Array
    (
       ...
    )

[2] => Array
    (
       ...
    )

[3] => Array
    (
       ...
  )

[4] => Array
    (
       ...
  )

[5] => Array
    (
       ...
   )

)

but it would deliver something like this:
Staff List
(
[1] => Director
    (
       ...
    )

[2] => Department Head
    (
       ...
    )

[3] => Head of FInance
    (
       ...
  )

[4] => Human Resource
    (
       ...
  )

[5] => etc
    (
       ...
   )

)

THANKS FOR YOUR ADVISE !

A: what you need is to have a Person class and initialize by 
class Person{
    public title;
    public name;
    //etc etc
}

//your CSV input mechanism
$person = new Person();
$person->title = "Head of something";
$person->name = "name1";

array_push($arry,$person);

but if you absolutly need something like
Array (
    "Head of something" => ("name1","etc")
)

like thing you need to se the variable variable name feature of php
$arry[$$title] =  array("name1","etc");


A: Please replace this line 
$data[$cols[$i]][$cols[$c]] = $col; 
instead of 
$data[$i][$cols[$c]] = $col;
I Hope this will work what you expect.
