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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:54:07+00:00 2026-06-10T04:54:07+00:00

I have to pass an index to a function and from that index return

  • 0

I have to pass an index to a function and from that index return a string containing from 1 to 4 chars.

I have:

$string = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';

So if I say index(20) the function should return lower “k” because it is its index in the $string variable.

But…

If I type indexes

62 it should return 10
63 .. 11

That is because from index 62 it should start the string from 1, not 0, and loop until the next index, so they will be 2 length string

If I type indexes

3843 .. ZZ

That is because from index 3843 all the possibilities from [0-9a-zA-Z][0-9a-zA-Z] have ended and now the string starts with 3 length.

3844 .. 100

...

9999 .. 2Bh

All the possibilities and at [0-9a-zA-Z][0-9a-zA-Z][0-9a-zA-Z] but I only need until index 9999

  • 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-10T04:54:09+00:00Added an answer on June 10, 2026 at 4:54 am

    Your question is a bit hard to understand, not sure if this is what you want:

    $string = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; 
    
    function t($n)
    {
        global $string;
        $ret = $string{$n%62};
        if($n>=62)
            $ret = t(floor($n/62)).$ret;
        return $ret;
    }
    
    echo t(9999);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying I have a string that I pass into my function from user
Let's say I have a web page ( /index.html ) that contains the following
I have links in my site that pass queries to pages that query from
I have a parsing function that parses an encoded length from a byte buffer,
You have to pass the args variable to the anonymous function, but the anonymous
I have to pass back information from a different source and can have a
I have to pass information from a desktop application to Web application and vice
I have a facebook app that requiers authorization, therefore I have to pass a
I am trying to pass a variable to a a function that I believe
I'm wondering if it is possible to pass form data from index.jsp file 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.