Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Membuat String Random dengan PHP

Berikut ini adalah contoh implementasi sederhana fungsi untuk men-generate String Random Dengan PHP.



function randomString() {
$length = 10;
$characters = '0123456789abcdefghijklmnopqrstuvwxyz';
$string ='';
for ($p = 0; $p < $length; $p++) {
$string .= $characters[mt_rand(0, strlen($characters))];
}
return $string;
}

Selamat mencoba dan semoga bermanfaat...


This post first appeared on Bow's, please read the originial post: here

Share the post

Membuat String Random dengan PHP

×

Subscribe to Bow's

Get updates delivered right to your inbox!

Thank you for your subscription

×