このようなリンクがありますhttp://site.com/numbers_and_letters/This_is_what-I-need_to-retrieve.html
基本的にこの部分を取得する必要があります。This_is_what-I-need_to-retrieve
また、ダッシュとアンダースコアをスペースに置き換えると、次のようになります。This is what I need to retrieve
私は正規表現に慣れていないので、これが私が使用しているものです:(動作しますが、パフォーマンスが低下します)
function clean($url)
{
$cleaned = preg_replace("/http:\/\/site.com\/.+\//", '', $url);
$cleaned = preg_replace("/[-_]/", ' ', $cleaned);
//remove the html extension
$cleaned = substr($cleaned, 0,-4);
return $cleaned;
}