Jump to content

Generating random gibberish


hlstriker

Recommended Posts

Hi, can someone tell me how to generate about 8-10 chars worth of random gibberish and add it to a string please?

 

Example:

string = coolname;

gibberish = generating(gibberish!);

newstring = string . gibberish;

 

I really don't know how to generate the gibberish so I just made it up in that example.

Link to comment
https://forums.phpfreaks.com/topic/48731-generating-random-gibberish/
Share on other sites

or if you just want a-z A-Z,

 

<?php
function gibberish($size)
{
    $base = array_merge(range('a','z'), range('A','Z'));
    shuffle($base);
    return join('', array_slice($base, 0, $size));
}

echo gibberish(;
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.