Do you like my tutorials?

Then consider supporting me on Ko-fi

Talking about Php.

Today I had to generate some passwords, and I am not so creative in doing this.

So I coded a function I want to share with you.

How does it work?
Let’ see the parameters

lenght: is the password length (default = 8)
use_upper: set to 0 if you do not want to use uppercase chars (ABCD…), any other value otherwise. Default = 1
use_lower: set to 0 if you do not want to use lowercase chars (abcd…), any other value otherwise. Default = 1
use_number: set to 0 if you do not want to use number chars (0123…), any other value otherwise. Default = 1
use_custom: a string representing any extra char you want (such as ?*_ …). Default = empy string

Examples:

Enjoy and give me feedback.

Never miss an update! Subscribe, and I will bother you by email only when a new game or full source code comes out.