방법 1
던졌다 돌아오는 헤더정보로 판단

$url = '​http://www.example.com/picture01.jpg';
$header = get_headers($url);
$header_info = explode(" ", $header[0]);
if($header_info[1] == 200)
echo '<img src="​http://www.example.com/picture01.jpg"​ />';



방법 2
자바스크립트로 판단

<img src="hoge.jpg" style="display:none" onload="this.style.display='inline'">


출췌 : http://oshiete1.goo.ne.jp/qa4320629.html

+ Recent posts