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 7171697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:27:58+00:00 2026-05-28T15:27:58+00:00

the question title might be a bit confuse. but here is my case. i

  • 0

the question title might be a bit confuse. but here is my case.

i would like my result to like something like:

0000000000
    0000000001
    0000000002
    0000000003
    0000000004
    0000000005
    0000000006
    0000000007
    0000000008
    0000000009
    0000000010
0000000001
    0000000011
    0000000012
    0000000013
    0000000014
    0000000015
    0000000016
    0000000017
    0000000018
    0000000019
0000000002
    0000000020
    0000000021
    0000000022
    0000000023
    ...
0000000003
    ...
0000000004
    ...

i can get the first numbers by doing this:

for ($i = 1; $i<=10; $i++){
    $nr=str_pad($i, 10, "0", STR_PAD_LEFT);
    echo $nr.'<br>';
}

but then how do i get the numbers in between?

any ideas?

Thanks

edit: the second row of numbers are based on 10 by 10 count.

so. first record will have 10 other records underneath, the second record another 10 and so on.

i’ve tried something using $floor= floor($i/10); and adding that to the second set of records in here: $nr=str_pad($floor, 10, "0", STR_PAD_LEFT);

  • 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-28T15:27:58+00:00Added an answer on May 28, 2026 at 3:27 pm

    I don’t quite understand what you are trying to do. But one possible solution would be this:

    for ($i = 1; $i < 100; $i++){
    
        if ($i % 10 == 1)
            echo str_pad(($i-1)/10, 10, "0", STR_PAD_LEFT) . "<br />\n";
    
        echo '    '.str_pad($i, 10, "0", STR_PAD_LEFT) . "<br />\n";
    }
    

    See it in action.

    Depending on your problem, using two cycles might be better for you:

    for ($i = 0; $i < 10; $i++){
    
        echo str_pad($i, 10, "0", STR_PAD_LEFT) . "<br />\n";
    
        for ($j = 1; $j <= 10; $j++) {
            echo '    '.str_pad($i*10+$j, 10, "0", STR_PAD_LEFT) . "<br />\n";
        }
    }
    

    Live.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The title of this question might be a bit off but its the closest
Question title might be meaningless, but I tried. :) Here's my situation: I have
The title might be a bit misleading, but I couldn't figure out a better
The title of this question might be confusing but the problem is simple. I'm
The title might be somewhat ambiguous, but bear with me (The only similar question
The title might been misleading, but I can´t pack my question in one sentence.
The original question: The title of this question might be a bit clumsily phrased,
Probably question title might looks strange for you, but I'll try to explain. I
the title might be too generic, but I have a very specific question about
I asked a question , title of which might have been misleading so I'm

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.