<?php

//test
$chrs = array_merge(range('a', 'z'), explode(',', '.,?,!, '));
$encode = array_fill(1, 6, array());
for ($i = 1; $i <= 6; $i++) {
    for ($j = 1; $j <= 5; $j++) {
        $encode[$i][$j] = array_shift($chrs);
    }
}