Jump to content

Recommended Posts

I need to be able to echo everythink that is in an array, It has to echo all of them, the code I have written would only echo 3 out of the 5 sometimes less sometimes it will repeat the same thing 2 or 3 times, I need it to be different each time, it should be able to echo all 5 parts of the array randomly and then it keep going in a cycle...

 

ive tried

 

array_rand()

rand()

shuffle()

 

with no luck, Any help is appreciated,

Link to comment
https://forums.phpfreaks.com/topic/238172-need-some-help-with-this/
Share on other sites

let me see if I can explain with more detail

 

basically what I can trying to do is this

 

 

I have a file with ID numbers and security keys for my user accounts in this format

 


// ID(space)Security Key

12354390 48ghsgyew89380sdjoakk
12345560 38gdsfdsgdfhfdsfdsfwwrk
12346660 48jod43dsgdrfgdfewewrk

 

That is just gibberish above to show as an example, this is the code I use to sort the ID and security tokens from the  text file

 


<?php

$keys = file($info_file);
foreach($keys as $values)
  {
  $Var = explode(' ', $values);
  $Info[] = array($Var[0], trim($Var[1]));
  }

?>

 

so after using that ... $Info[0] would equal 12354390 and $Info[1] would equal 48ghsgyew89380sdjoakk

 

Here is the loop I use

 


$Variable[] = "var 1";
$Variable[] = "var 2";
$Variable[] = "var 3";


for($i=0; $i<count($Info); $i++)
  {
for($a=0; $a<count($Variable); $a++)
  {
	$load = file_get_contents('http://www.example.com/k?='.$Info[$i][0].'&variable='.$Variable[$a].'&security='.$Info[$i][1]);
	sleep(1);
  }
  }

 

I need to randomize the $Info array in the file_get_contents and I would like to randomize the $Variable as well, the "$i" in $Info[$i][0] amd $Info[$i][1] has to be the same so it matches up, or else it would failed the security check... I would need it to randomize but not repeat any of the variables when it loads the webpage, cannot repeat, or cannot miss any, I know that sounds confusing Lol, let me know and I will try to explian a little bit better

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.