echo random_bytes($length);
$str=random_bytes(7); echo bin2hex($str);
09b0489fe65960
Post your comments , suggestion , error , requirements etc here