3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'This is my test string with an <img test /> image. <test />'; $pattern = '/<([a-zA-Z0-9]*)(.*)\/>/i'; $count = preg_match_all($pattern, $string, $matches, PREG_SET_ORDER); print_r($matches);

preferences:
47.67 ms | 402 KiB | 5 Q