I would to see another way to convert some of the character in the string to mixed case i think my way is not the optimal way..
$arr_str = str_split("w2abcd");
$atCase = "";
foreach ($arr_str as $cha) {
$toup = rand(0, 1);
if($toup == 1){ $atCase .= ucfirst($cha); } else { $atCase .= $cha;}
}
$rtnstr = $atCase;