获取不带后缀的远程图片文件(比如:www.xxxx.com/photo)
muke
每日精进
muke
2022-06-06 21:19:29
2106
{{single.collect_count}}
$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;
}
回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}