3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '<li data-type="mentionable" data-id="2">bla bla... <li data-type="mentionable" data-id="812">some test <li>bla bla </li>more text <li data-type="mentionable" data-id="282">'; preg_match_all("/data-id=\"(\d+)\"/", $str, $matches); print_r($matches[1]);

preferences:
24.58 ms | 405 KiB | 5 Q