Php 我怎样才能从这里得到URL?

Php 我怎样才能从这里得到URL?,php,html,Php,Html,我收到了很多关于我的网站的DMCA删除邮件,我正在尝试从我的网站上自动删除这些曲目 这些邮件看起来都很像这样 http://example.com/title-to-post.html title - to post http://example.com/title-of-post.html title - of post http://example.com/some-song-artist-some-song-name.html some song artist - some song na

我收到了很多关于我的网站的DMCA删除邮件,我正在尝试从我的网站上自动删除这些曲目

这些邮件看起来都很像这样

http://example.com/title-to-post.html title - to post
http://example.com/title-of-post.html title - of post
http://example.com/some-song-artist-some-song-name.html some song artist - some song name
但是有很多,我只想返回每个部分的URL部分,下面的例子就是

http://example.com/title-to-post.html
http://example.com/title-of-post.html
http://example.com/some-song-artist-some-song-name.html
编辑:我将这些文件存储到一个txt文件中,然后使用标准代码调用它们

$urls = file_get_contents( "oururls.txt" );
$data = explode(",", $urls);
    foreach ($data as $item) {
    echo "$item";
    echo '<br>';
}
$urls=文件获取内容(“oururls.txt”);
$data=分解(“,”,$URL);
foreach($数据作为$项){
回显“$item”;
回声“
”; }

没有什么特别的事情发生,不管它是如何返回标题的,我只想要URL

如果URL后面总是有一个空格,你可以按“”分解文本并得到第一部分。例如:

$example = explode(" ", $url);
echo $example[0];