3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = "http://example.com/our-post-name-here-number-one-81347.html our post name number one http://example.com/our-post-name-here-number-two-81348.html our post name number two http://example.com/our-post-name-here-number-three-81349.html our post name number three"; $array = explode("\n", $s); foreach ($array as $item) { $removed = "copyright"; $nothing = ""; $url = explode(" ", $item); $data = $url[0]; $explode = explode(".html", $data); // other functions $primary = $explode[0]; $pieces = explode("-", $primary); $number = array_pop($pieces); print $number; print '<br>'; }
Output for 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
81347<br>81348<br>81349<br>

preferences:
102.13 ms | 1633 KiB | 4 Q