Write a PHP function to create a human-readable random string for a captcha.
<?php function random_string($length = 5) { $chars = 'bcdfghjklmnpqrstvwxyzaeiou'; for ($x = 0; $x < $length; $x++) { $result .= ($x%2) ? $chars[mt_rand(19, 23)] : $chars[mt_rand(0, 18)]; } return $result; } echo random_string(); ?>
Sample Output:
rasyn
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer