note 115672 deleted from function.substr by peehaa
| From: | peehaa@php.net | Date: | Mon, 28 Nov 2016 19:57:15 +0000 |
| Subject: | note 115672 deleted from function.substr by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207725@lists.php.net to get a copy of this message | ||
Note Submitter: goren dot ali at NOSPAM dot yandex dot com
----
II use my random password generator class
<?php
/*
* Ali GOREN
*
*
*/
class SifreOlusturucu {
//var $boyut; test
function __construct($boyut = 8) { // 8 default, 14 or more good and recommended length
$this->boyut = $boyut;
}
function sifreOlustur() {
//$this->boyut;
$karakterler =
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?';
$sifre = substr( str_shuffle( $karakterler ), 0, $this->boyut);
print_r($sifre);
}
}
$olustur = new SifreOlusturucu(16);
$olustur->sifreOlustur(); // output: wIsLiXzH1uP@hqSm