3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(0=>"Premier: 3/svart/XL ID:35235", 1=>"Premier: 3/vit/S ID:9999", 2=>"Premier: 2 ID:333"); foreach ($a as $b) { $list_premier = explode('ID',$b); $premier = trim(substr($list_premier[0],10)); echo $premier . " => "; $premier = str_replace( array(' ', '1' , '2', '3'), array(' + ', 'tygvƤska', 'te', 't-shirt'), $premier ) ; echo $premier . "\n"; }
Output for 4.3.0 - 5.6.25, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
3/svart/XL => t-shirt/svart/XL 3/vit/S => t-shirt/vit/S 2 => te