Jump to content

Duplication list values


graham23s

Recommended Posts

<?php
 // Daniel URL duplicator.
 // Input links list.
 $linksList = "links.txt";
 // How many times to duplicate the url?
 $manyTimes = 1000;
 // Read in the list.
 for ($x = 0; $x <= $manyTimes; $x++)
 {
  $handle = fopen($linksList, "r");
  $line = fgets($handle);
  echo $line;
  fclose($handle);
 }
?>

Hey Guys,

 

I'm stuck on this simple bit of code lol what I'm trying to do is load in a list of urls:

 

site1.com

site2.com

site3.com

etc

 

For each site that is read, I'm trying to duplicate it X times, above would print to screen the same url 1000 times, then move onto the next print it 1000 times etc until the list is done (or how ever many times I select)

 

I can't think of the best way to do it!

 

any help would be appreciated guys!

 

Graham

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/291173-duplication-list-values/
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.