如何从范围函数中获取数组中的单个值

It's been a late night so this I know is a pretty easy question. I have the following code:

$letters = range('A', 'Z');
$inx = 0;
$unique = false;
$num = substr($vin,-6);
while($unique != true){
    if($inx > 0){
        $num = substr($vin,-6) + $letters[$inx];
    }
    $this->db->where('stockid', $num);
    $query = $this->db->get('vehicles');
    if($query->num_rows() < 1){
        $unique = true;
    }
    $inx++;
}

I get an error because it is not pulling a letter and adding it to the string where it states:

$num = substr($vin,-6) + $letters[$inx];

You can try to use this instead:

$num.=$letters[$inx];

versus

$num = substr($vin,-6) + $letters[$inx];

Because we often use "+" in Javascript.