Jump to content

This array is not working for me...


devWhiz

Recommended Posts

Ok so I have a file with data like this

 

530450112 1dda5a716d3f1fa8eb77ab6342b93db11a195698
530454485 90a7da1adab91b946765c050dffbf15c2dc2d973
530445119 89b5ee9bce1efb1858905069130692122917ce2e
533930984 0802f4cb048bac747b87f4bc9a6f9bbe92d38d8a

 

Now the code I have...

 

$KeysFile = 'keys.txt'; // File with keys....

$keys = file($KeysFile);
foreach($keys as $aKeys)
  {
  $Keys = explode(' ', $aKeys);
  $AccountInfo[] = array($Keys[0], trim($Keys[1]));
  }

for($z=1; $z!=$AccountData; $z++){

var_dump($Keys[0]);
}

 

why does it print out the last id of the script 4 times instead of each of the id numbers once?

 

its like

 

string(9) "533930984"
string(9) "533930984"
string(9) "533930984"
string(9) "533930984"


 

shouldnt it be

 

string(9) "530450112"
string(9) "530454485"
string(9) "530445119"
string(9) "533930984"

 

Helppp  :confused:

 

Thanks

 

Link to comment
https://forums.phpfreaks.com/topic/231241-this-array-is-not-working-for-me/
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.