3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function makeCatList($param){ $arResult = array(); $s = array("/[aаА]/ui","/[bбБ]/ui","/[cсС]/ui","/[dдД]/ui","/[eеЕ]/ui","/[tтТ]/ui","/[rрР]/ui","TB"); $r = array("A","B","C","D","E","T","r","Tb",); preg_replace($s, $r, $param["string"]); if(preg_match_all("/((?:[A-D]1)|(?:[A-D][E]?)|(Tr|Tb))/u", $param["string"], $mCats)){ //unset($mCats[0]); print_r($mCats); return asort($mCats); } else return false; } print_r(makeCatList(array("string"=>"Ав1beс1edeTr")));
Output for 4.3.11 - 7.1.0
Warning: preg_replace(): Delimiter must not be alphanumeric or backslash in /in/GmEqq on line 6 Array ( [0] => Array ( [0] => Tr ) [1] => Array ( [0] => Tr ) [2] => Array ( [0] => Tr ) ) 1
Output for 4.3.0 - 4.3.10
Warning: Delimiter must not be alphanumeric or backslash in /in/GmEqq on line 6 Array ( [0] => Array ( [0] => Tr ) [1] => Array ( [0] => Tr ) [2] => Array ( [0] => Tr ) ) 1