<?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]; }
You have javascript disabled. You will not be able to edit any code.