获取不带后缀的远程图片文件(比如:www.xxxx.com/photo)
MUKE VIP1
Believe that you can do better
文章
30
评论
35
粉丝
1
MUKE
VIP1
2022-06-06 21:19:29
150
$url = parse_url($url);
if ($fp = @fsockopen($url['host'], empty($url['port']) ? 80 : $url['port'], $error)) {
    fputs($fp, "GET " . (empty($url['path']) ? '/' : $url['path']) . " HTTP/1.1\r\n");
    fputs($fp, "Host: {$url['host']}\r\n\r\n");
    while (!feof($fp)) {
        $tmp = fgets($fp);
        if (trim($tmp) == '') {
            break;
        } else if (preg_match('/Content-Type:(.*)/si', $tmp, $arr)) {
            return trim((string)$arr[1]);
        }
    }
    return null;
} else {
    return null;
}
回帖
回帖
全部回帖({{crcount}})
{{item.user.nickname}} {{item.user.group_title}} {{common.diaplayTime(item.create_time)}}
{{item.content}}
{{item.comment_content_show ? '取消' : '评论'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{common.diaplayTime(reply.create_time)}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}