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