3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = '{{$firstName}}, {{$productName_67003}}'; if (preg_match_all('/{{\$productName_(\d{1,})}}/', $str, $matches)) { foreach ($matches[1] as $productIdKey => $productId) { $tst = str_replace( $matches[0][$productIdKey], '!!!!!!!!@@@@@@', $str ); } } echo $tst;
Output for 4.3.0 - 7.1.0
{{$firstName}}, !!!!!!!!@@@@@@