- substr: documentation ( source)
- strrpos: documentation ( source)
<?php
$str = 'http://www.azlyrics.com/a/abba.html';
$pos = strrpos($str, '.html');
$get = substr($str, 0, $pos);
echo $get;
$pos2 = strrchar($get, '/');
$get2 = substr($get, $pos2, '-0');
echo $get2;