How to download php gift certificate generator?

Asked By 20 points N/A Posted on -

Hello experts,

How to download php gift certificate generator codes? Php is the best programming language that technology can offer and I am just wondering about gift certificate generator sample codes. This is all related to my html programs before, I want to learn more.

Answered By 0 points N/A #130034

How to download php gift certificate generator?



Below is the code which will help you in generating the random code. Which can be used for generating gift code.

//To Pull 8 Unique Random Values Out Of AlphaNumeric

//removed number 0, capital o, number 1 and small L
//Total: keys = 32, elements = 33
$characters = array(

//make an "empty container" or array for our keys
$keys = array();

//first count of $keys is empty so "1", remaining count is 1-7 = total 8 times
while(count($keys) < 8) {
    //"0" because we use this to FIND ARRAY KEYS which has a 0 value
    //"-1" because were only concerned of number of keys which is 32 not 33
    //count($characters) = 33
    $x = mt_rand(0, count($characters)-1);
    if(!in_array($x, $keys)) {
       $keys[] = $x;

foreach($keys as $key){
   $random_chars .= $characters[$key];
echo $random_chars;

Login/Register to Answer

Related Questions