Ask to generate letters plus numbers

Source: Internet
Author: User
There are 26 letters {A-Z} and 10 numbers {0-9}
If you want to generate 8-bit characters, the case-sensitive,
This arrangement is (26+26+10) 8 times Square = 218,340,105,584,896, which 218 trillion
But adjacent cannot have two or more of the same as {a1b2cc90, this character appears two times CC}
Can such data be generated in PHP?
If generating a single text data should be less likely to be cut into many parts ...


Reply to discussion (solution)

What does that mean?

$d = Str_split (' ABCD ');p Rint_r (Array_map (' Join ', F (4, $d))), function f ($n, $d) {  $t = Array_chunk ($d, 1);  if ($n > 2) $t = f ($n-1, $d);  foreach ($t as $x)    foreach (Array_chunk ($d, 1) as $y) {      if (end ($x)! = End ($y)) $r [] = Array_merge ($x, $y);    }  return $r;}
Array ([0] = abab [1] = ABAC [2] = Abad [3] = = ABCA [4] = = ABCB [5] [= ABCD] [6]    = ABDA [7] = ABDB [8] = ABDC [9] = = Acab [ten] = ACAC [one] = Acad [] = ACBA [19] = ACBC [] = ACBD [[+]] = ACDA [+] = acdb [+] = ACDC [[+]] = = Adab -ADAC [+] = Adad [+] = ADBA [] = ADBC [] = adbd [] = ADCA [+] = AD CB [3] = ADCD [+] = Baba [] = babc [] = babd [+] = Baca [[+] = + BACB  2] = [BACD] = bada [] [+] = badb [+] = BADC [+] = Bcab [Panax Notoginseng] = BCAC [+] =    BCAD [+] = BCBA [+] = BCBC [All] [] = BCBD [[] = BCDA [] = bcdb [] = BCDC [Bdab] = [[]] = BDAC [+] = Bdad [[] = BDBA [in] = BDBC [[] = BDBD [51] =& Gt BDCA [~] = bDCB [+] = BDCD [si] = caba [+] = CABC [[+] = cabd [] = caca [+] = CACB [ [+] = CACD [] = Cada [All] = cadb [+] = CADC [+] = Cbab [+] = Cbac [] =&gt ;    Cbad [[+] = CBCA [[+] = CBCB [] [] = CBCD [] = Cbda [] = CBDB [[]] = CBDC [Cdab] = [[] = [] = CDAC [All] = Cdad [] [] = cdba [] = CDBC [All] = CDBD [+] =&G T    CDCA [[+] = CDCB [] = CDCD [Bayi] = Daba [[+] = DABC [the] [] = DABD [+] = DACA [DACB] = [[+]] = DACD [[+]] = Dada [+] = DADB [[]] = DADC [All] = Dbab [] =&G T    Dbac [[] = Dbad [[]] = DBCA [94] = DBCB [up] = DBCD [] [] = Dbda [] = Dbdb [98] = DBDC [[+]] = Dcab [[+] = DCAC [101] = Dcad [102] = DCBA [103] = DCBC [104    ] = DCBD[DCDA] = [106] = dcdb [107] = DCDC) 

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.