3v4l.org

run code in 300+ PHP versions simultaneously
<?php $itemFullName = "10-16X4 POLI MG SELF START BLK PLASTIC"; if(preg_match("@(POLI){1}(.)+(BLK)@", $itemFullName)) { $itemAttributes = preg_replace("@(POLI){1}(.)+(BLK)@", "#", $itemFullName); } echo $itemAttributes;

preferences:
38.35 ms | 402 KiB | 5 Q