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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:37:21+00:00 2026-06-08T07:37:21+00:00

I have a few letters; for example a, b, c, d and e. For

  • 0

I have a few letters; for example a, b, c, d and e.

For each one of them, I have sets of two-character values like this:

a -> fg, dz, gc, bg

b -> zt, hg, oq, vg, gb

c -> lt, pr, cs, sh, pr

d -> kt, nt, as, pr

e -> zd, ke, cg, sq, mo, ld

Here comes the question:

I would like to get a random value for each time for example: dcbae
and for this the ultimate output should be something like this: ntshztdzld or asltvggcmo, etc.

(After generating a random string with the characters above (between a-e), it should generate another string that contains random values those are related with the each character.

  • 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-08T07:37:23+00:00Added an answer on June 8, 2026 at 7:37 am

    Well, you would first create a map:

    $map = Array(
        "a" => Array("fg","dz","gc","bg"),
        "b" => Array("zt","hg","oq","vg","gb"),
        "c" => Array("lt","pr","cs","sh","pr"),
        "d" => Array("kt","nt","as","pr"),
        "e" => Array("zd","ke","cg","sq","mo","ld")
    );
    

    I notice that you have the same pair “pr” several times – if you want this encoding to be reversible, avoid duplicates.

    Anyway, once you have that it’s easy enough to loop through your input string and get a random output:

    $input = "dcbae";
    $len = strlen($input);
    $output = "";
    for( $i=0; $i<$len; $i++) {
        $entry = &$map[$input[$i]];
        if( isset($entry)) $output .= $entry[mt_rand(0,count($entry)-1)];
        else $output .= "??";
    }
    

    $output is the result.

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

Sidebar

Related Questions

I have a web-page that looks like this (simplified example) <table id=events_results_table> <thead> <tr>
When you have a remote datasource and min character limit, typing a few letters,
Vim's Ctrl + N generally works like this: I type few letters, hit Ctrl
I have few text fields like SSN , phone number and email id. I
I have few question in this regard When you create an internet page, does
We have few components like libraries dlls When initially created I ran the following
On a micro-controller program I have a few instructions that I would like to
I have a string of letters ' aaabbbcccdddeeefffggg ' that i would like to
I like the plyr syntax. Any time I have to use one of the
I have this unusual scenario: I have a registrationVO with few properties and getter

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.