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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.