How to generate random character strings in a range in PHP?

Sometimes you may need to generate random strings, such as different passwords. This article tries to show you some tricks to generate different random strings in PHP.

The following function acctepts one argument $length which is number of characters on the return word. You can change the arguments to get your need.

 

I have been developing websites & web applications since 2004 and currently working in London as full-stack Senior Web Developer. I utilize and advocate in the layout, design and coding of websites specifically in PHP format. Experienced in developing applications and solutions for a wide range of corporate, charity and public sector clients and having the enthusiasm and ambition to complete projects to the highest standard. My ulitmate focus is on server side programming, release process, automation, and standards based web site & applications especially on Zend Framework. I also have a keen interest in developing Wordpress plugins and contributing to open source projects.

Leave a Comment

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

*
*

*

code