- explode: documentation ( source)
- array_pop: documentation ( source)
<?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>';
}