답변 3개 / 댓글 1개
채택된 답변
+20 포인트
Copy
<?php
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$random_string = '';
for ($i = 0; $i < 4; $i++) {
$index = rand(0, strlen($characters) - 1);
$random_string .= $characters[$index];
}
echo $random_string;
?>
답변을 작성하려면 로그인이 필요합니다.