<?php

$chars=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
$n=3;
print_r(array_intersect_key($chars,array_flip(array_rand($chars,$n))));

?>