Are there best practices for creating unique, yet pronounceable usernames using PHP?

When creating unique usernames using PHP, it's important to generate names that are both unique and pronounceable to ensure user-friendliness. One approach is to combine random syllables or words to create a unique username that is still easy to pronounce. This can be achieved by generating random syllables or words and concatenating them together.

function generateUsername($length = 8) {
    $vowels = array('a', 'e', 'i', 'o', 'u');
    $consonants = array('b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z');
    
    $username = '';
    $is_vowel = mt_rand(0, 1);
    
    for ($i = 0; $i < $length; $i++) {
        if ($is_vowel) {
            $username .= $vowels[array_rand($vowels)];
        } else {
            $username .= $consonants[array_rand($consonants)];
        }
        
        $is_vowel = !$is_vowel;
    }
    
    return $username;
}

echo generateUsername(); // Output: "piboguwo"