append char to string in programatically looping in php

i'm very confused here.

How can I loop this:

start from 0-9a-zA-Z

foreach alphanumeric char from the above range, I have to create a string

the very fist string will be

0000
... ( thousands of string generated between)
0009
... ( thousands of string generated between)
000a
... ( thousands of string generated between)
000z
000A
... ( thousands of string generated between)
000Z
.... ( thousands of string generated between)
ZZZA
... ( thousands of string generated between)
ZZZZ

Answers


Here is one solution:

$corpus = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
for( $i = 0; $i < strlen($corpus); $i++ )
   for( $j = 0; $j < strlen($corpus); $j++ )
      for( $k = 0; $k < strlen($corpus); $k++ )
         for( $l = 0; $l < strlen($corpus); $l++ )
              print substr($corpus, $i, 1).substr($corpus, $j, 1).substr($corpus, $k, 1).substr($corpus, $l, 1)."\n";

Need Your Help

How to parse this JSON String with GSON?

java json gson

Can't figure out how to parse the following JSON string with GSON into any proper object to retrieve its data.