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

  • Home
  • SEARCH
  • 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 7611745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:44:20+00:00 2026-05-31T01:44:20+00:00

I was making a short little program to split a long integer into smaller

  • 0

I was making a short little program to split a long integer into smaller bits. At the moment, what it does is simply put one digit of the int orderly into an index of $arr.

$grip = 10001; $fade = '';
for ($i = 1; $i <= trim($grip); $i++) {
   $par = rand(0, 9); $fade .= "$par"; }
$arr = chunk_split($fade, 451, "\r\n");
echo $arr[1]; sleep(10);

I’m really hoping chunk_split does what I think it does and splits a string/int by a certain length…. Any help is thankfully accepted. 😀

  • 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-05-31T01:44:22+00:00Added an answer on May 31, 2026 at 1:44 am

    chunk_split() doesn’t return an array, but rather a string. If you want to use it, you would have to convert the string returned by chunk_split() into an array:

    $arr = explode("\n", chunk_split($fade, 451, "\n"));
    

    If you want an efficient solution though, you might want to consider something like:

    $grip = 10001;
    $fade = '';
    $arr = array();
    
    for ($i = 1; $i <= $grip; $i++) {
        $fade .= rand(0, 9);
        if ($i % 451 == 0) {
            $arr[] = $fade;
            $fade = '';
        }
    }
    
    if (!empty($fade)) {
        $arr[] = $fade;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Long story short, I'm making a custom Swing component that's basically a JTable with
I'm making a little program that will crawl my hard drive and present a
Long story short, I'm making a racing game in Java. I'm self-taught using some
Short version: I want to trigger the Form_Load() event without making the form visible.
I'm making a little game, here is some example code of whats going on:
I'm making a script parser in python and I'm a little stuck. I am
I'm making little utility to help me generate code for an app I'm making.
I'm making a short database application where people can assign variables to something. like
For a little iPhone application I am making, I want to sort a NSMutableArray.
I'm making a student management system on apex. The short of it is a

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.