![]() one uppercase letter, one digit, and one special character. In the above example, I once chose a length of 10 characters. // Generates a strong password of N length containing at least one lower case letter. If you replace the 10 with a different number, you can shorten the number of characters. If this should be too long for your purpose, you can also directly limit the string with substr(): echo substr(md5(rand()),0,10) The function rand() creates a random number and md5() makes an MD5 hash from that, which will look similiar to the second line above. ![]() htmlspecialchars ( make_password ( 16 )).The easiest way to achieve this, is as follows with a combination of md5() and rand(): echo md5(rand()) So to show pass in a html document you'd say : There's a built-in function to make texts html friendly, see htmlspecialchars : so if you want the browser to show
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |