Jump to content

Array keys are Zero


livewirerules

Recommended Posts

Hi

Im trying to load telephone numbers from a csv file and work around the array key values. But when when i try all the key values seems to be Zero. I tried to sort and assing new array key values but still its the same.

Below is the code

 

if (($open=fopen("phone.csv","r"))!== FALSE) {

while (($data=fgetcsv($open))!==FALSE) {


		foreach ($data as  $key =>$numbr){

/// working code logic


echo $key."<br>"; 

		}

}}

 

 

the output is as below

0
0
0
0
0
0
0

can someone please tell me how to assign the keys.

Link to comment
https://forums.phpfreaks.com/topic/239235-array-keys-are-zero/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.