3v4l.org

run code in 300+ PHP versions simultaneously
<?php $artigos = [ "Art. 1 lala 23", "Art. 2 lala 23", "Art. 3 lala 23", "Art. 4345 lala 23", ]; $artigos_len = count($artigos) -1; for ($i=0; $i <= $artigos_len; $i++) { preg_match("/Art\. (\d+)/i",$artigos[$i],$match); echo "<ul class='artigo {$match[1]}'></ul>\n\r"; }

preferences:
28.34 ms | 404 KiB | 5 Q