Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8065221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:35:56+00:00 2026-06-05T11:35:56+00:00

About the script: The script below will create 300 sets of random characters. What

  • 0

About the script:

The script below will create 300 sets of random characters.

What is presently happening, is that it creates them but shows them all on one line, in one big chunk.

With all the searching and testing I’ve done to try and achieve this, I have had no success.

I would like to know which code and where to put it, so that each SET (300) of 15 characters long, will show and be saved to file.

Here is my script:

<?php

function GetID($x){

$characters = array_merge(range('A','Z'),range('a','z'),range(2,9));
shuffle($characters);


for($x=0;$x<=299;$x++){

}

for (; strlen($ReqID)<$x;){
$ReqID .= $characters[mt_rand(0, count($characters))];
}


return $ReqID;
}     

$ReqID .= GetID(5);
$ReqID .= "-";
$ReqID .= GetID(5);
$ReqID .= "-";
$ReqID .= GetID(5);


echo $ReqID;


$fh = fopen("file.txt","a+");
fwrite($fh, ("$ReqID")."\n");
fclose($fh);

?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T11:35:59+00:00Added an answer on June 5, 2026 at 11:35 am

    Modify you GetID function to insert a new line at every 15th character:

    function GetID($x){
       $characters = array_merge(range('A','Z'),range('a','z'),range(2,9));
       shuffle($characters);
       $ReqID='';
       for ($i=0; strlen($ReqID)<300; $i++){
          $ReqID .= $characters[mt_rand(0, count($characters))];
          if ($i>0 && $i%15 == 0)
             $ReqID .= "\n";
       }
       return $ReqID;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working to create a simple Python script that will ultimately tell you how
I've got a massive script with about 20 embedded if statements (Yay!) that is
I have a simple script that pulls about 100 million results, 1 million at
I am looking to create a Windows batch script to move about 2,000 files
I have a perl cgi script that's fairly resource intensive (takes about 2 seconds
I have the Execute SQL Script package that contains the script to insert about
I am writing a script at the moment that will grab certain information from
Any idea on garbage collector timer in javascript? Suppose i run below script, will
i looking to make a small script that will understand pagination of urls i
I am attempting to create a php script that can connect thru ssh to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.