function random_chars($length = 12) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_?,."; $rand_chars = substr( str_shuffle( $chars ), 0, $length ); return $rand_chars; }