My post got deleted. Not sure why? I'm new at PHP and apparently new at forum 🙂 I'll try again...
I am trying to create multilevel keys for the some data from a csv sheet.
I figured out how to get the rows to be defined as $array13 in the following amended code...
<?php
$file_handle = fopen("web_contacts.csv", "r");
while (!feof($file_handle) ) {
$array13 = fgetcsv($file_handle, 1024);
//for ($i=0;$i<=4;$i++) {
//echo $array13[$i] . "<br>";
//}
print_r($array13);
}
fclose($file_handle);
?>
The "view source" show...
Array
(
[0] => Rafael Z
[1] => PASC
[2] => Chairperson
[3] => ascchair@peninsulana.org
)
Array
(
[0] => Nick A
[1] => PASC
[2] => Vice Chairperson
[3] => ascvicechair@peninsulana.org
)
Array
(
[0] => OPEN
[1] => PASC
[2] => Tresurer
[3] => asctreasurer@peninsulana.org
)
Array
(
[0] => Viktoria L
[1] => PASC
[2] => Secretary
[3] => ascsecretary@peninsulana.org
)
What I'm trying to do is assign a key value to the $array13 each time "while" is satisfied (maybe it's foreach?)
Array [0] =>
(
[0] => Rafael Z
[1] => PASC
[2] => Chairperson
[3] => ascchair@peninsulana.org
)
Array [1] =>
(
[0] => Nick A
[1] => PASC
[2] => Vice Chairperson
[3] => ascvicechair@peninsulana.org
)
Array [2] =>
(
[0] => OPEN
[1] => PASC
[2] => Tresurer
[3] => asctreasurer@peninsulana.org
)
Array [3] =>
(
[0] => Viktoria L
[1] => PASC
[2] => Secretary
[3] => ascsecretary@peninsulana.org
)
So $array13[1][2] == "Vice Chairperson"
I've search the forums and tried like 10 different approaches with no luck.
HELP!