I have this in PHP:
$_chars = "0123456789ZXCVBNMASDFGHJKLQWERTYUIOP";
for($l = 0; $l<4; $l++){
$temp = str_shuffle($_chars);
$_charcode .= $temp;
}
I want it to only generate 4 characters. Currently It's generating 6. I've tried editing $l but it doesn't change anything.
str_shufflereturns the whole string, not just one character. You're actually getting a 144 character (4 * 36) string.