- str_split: documentation ( source)
<?php
$str = "111000111111";
//preg_match_all('/(.)\1*/', $str, $match);
$digits = str_split($str, 4);
$replace = array("1110" => "A", "0011" => "B", "1111" => "C");
Foreach($digits as $val){
Echo $replace[$val];
}