Create random strings in PHP

I made a PHP function which returns a random string using Alphabets [a to z] and [A to Z], Numbers [0 to 9]. It is very easy to use and can be easily modified.

How to call it ??

Note: You can remove any of the ranges in $valid_characters (For e.g. if you do not want uppercase letters in random string then delete the range('A','Z')) or you can put you own array of custom characters.

Leave a Reply

Your email address will not be published. Required fields are marked *