3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $substituir = array('MEC','AUT','SED','F.POWER','ECONOFLEX','COMF','T.FLEX','T. FLEX','TOT.FLEX','T. FIELD','TIPTRON','I MOTION','TIPTR','STRONIC','SEDÃ','C.STYLE','C.PLUS','C./','AVANTGARD','AVANGARDE','CUPÊ','CUPÉ','COUPÊ','RANGE R.EVOQUE','DISCOVERY4','FREELANDER2','FURG\\.','MEC\\.','AUT\\.','EXEC\\.','CONV\\.','SED\\.','INTERC.','EXPRES\\.','CLASS\\.','HAT\\.','PREM\\.','POW\\.','FLEXP\\.','ADVANT\\.','ECONOF\\.','EXPRES\\.','TIP\\.','COMF\\.','HIGHLI\\.','LUG\\.','EXCLUS\\.','EXCL\\.','LIMIT\\.','ELEG\\.','KOMP\\.','TOUR\\.','EXECUT\\.','EVOL\\.','EVOLUT\\.','INT.','BLIND\\.','INTERC\\.','SED\\.','PRIV\\.','EXPRES\\.','EXP\\.','RANGE R\\.'); $novo = array('MANUAL','AUTOMÁTICO','SEDAN','FLEXPOWER','ECONO.FLEX','COMFORTLINE','TOTAL FLEX','TOTAL FLEX','TOTAL FLEX','TRACK & FIELD','TIPTRONIC','I-MOTION','TIPTRONIC','S-TRONIC','SEDAN','COMFORT SYTLE','COMFORT PLUS','COMFORT','AVANTGARDE','AVANTGARDE','COUPÉ','COUPÉ','COUPÉ','RANGE ROVER EVOQUE','DISCOVERY 4','FREELANDER 2','FURGÃO','MANUAL','AUTOMÁTICO','EXECUTIVE','CONVERSÍVEL','SEDAN','INTERCOOLER','EXPRESSION','CLASSIC','HATCH','PREMIUM','POWER','FLEXPOWER','ADVANTAGE','ECONO.FLEX','EXPRESSION','TIPTRONIC','COMFORTLINE','HIGHLINE','LUGARES','EXCLUSIVE','EXCLUSIVE','LIMITED','ELEGANCE','KOMPRESSOR','TOURING','EXECUTIVE','EVOLUTION','EVOLUTION','INTERCOOLER','BLINDADO','INTERCOOLER','SEDAN','PRIVILÈGE','EXPRESSION','EXPRESSION','RANGE ROVER'); for($i = 0; $i <count($substituir); $i++){ if(strpos($substituir[$i],".")) { echo substr($substituir[$i],-1); $substituir[$i] = '#' . $substituir[$i] . '#i'; } else { $substituir[$i] = '#\b(' . $substituir[$i] . ')\b#i'; } } echo preg_replace($substituir,$novo,'CELTA SPIRIT/ LT 1.0 MPFI 8V FLEXP. 5p');
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
RXXXDES/E.....................................CELTA SPIRIT/ LT 1.0 MPFI 8V FLEXPOWER 5p