ȸ¿ø°¡ÀԡžÆÀ̵ð/ºñ¹øã±â
ȨÀ¸·Î


socketÀÌ¿ëÇÑ Å¸»çÀÌÆ® À̹ÌÁö Àбâ
12³â Àü
function fetch_url($url) {
    $url_parsed = parse_url($url);
    $host = $url_parsed["host"];
    $port = $url_parsed["port"];
    if($port==0) $port = 80;
    $path = $url_parsed["path"];

    if(empty($path)) $path = "/";
    if(empty($host)) return false;

    if($url_parsed["query"] != "") $path .= "?".$url_parsed["query"];
    $out = "GET ".$path." HTTP/1.0\r\nHost: ".$host."\r\n\r\n";
    $fp = fsockopen($host, $port, $errno, $errstr, 30);
    usleep(50);
    if($fp) {
        socket_set_timeout($fp, 30);
        fwrite($fp, $out);
        $body = false;
        while(!feof($fp)) {
            $buffer = fgets($fp, 128);
            if($body) $content .= $buffer;
            if($buffer=="\r\n")    $body = true;
        }
        fclose($fp);
    }else {
        return false;
    }
    return $content;
}

$image = fetch_url("url");
$f = fopen("./data/test.jpg","w");
$lock=flock($f,2);
if($lock) {
    fwrite($f,$image);
}
flock($f,3);
fclose($f);
ÃßõÃßõ : 631 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
2,255
¸¶¿ì½º¿À¹ö ·Ñ¸µÀ̹ÌÁö¸¦ jQuery·Î º¯°æÇϱâ
2,254
PHP 󸮼ӵµ ¿Ã¸®±â
2,253
input ¹Ú½º¿¡ ¾È³»¹®±¸ ³ªÅ¸³»±â
2,252
input textarea Æ÷Ä¿½º½Ã È¿°úÁÖ±â À̹ÌÁö
2,251
css background sprites À̹ÌÁö
2,250
Jquery ¸ðÀ½
2,249
¿À¸¥ÂÊ ¸¶¿ì½º Ŭ¸¯½Ã ³ªÅ¸³ª´Â ¸Þ´º
2,248
Å×À̺í Á¡¼±Å׵θ® ¸¸µé±â
2,247
¹è°æÀ̹ÌÁö Á¦¾îÇϱâ(°íÁ¤Çϱâ)
2,246
±ÛÀÚ Áٹٲްú ÁÙ¹Ù²Þ ±ÝÁö
2,245
Input ¹Ú½º¿¡ »ç¶óÁö´Â ¹è°æ ³Ö±â
2,244
ÅؽºÆ® overflow
2,243
border-style¼Ó¼ºÀÇ °ª
2,242
Input ¹Ú½º¿¡ Æ÷Ä¿½º µÇ¾úÀ»¶§ ½ºÅ¸ÀÏ º¯°æ
2,241
CSS Intro
2,240
CSS¿ë¾î Á¤¸®
2,239
JavaScript Copy to Clipboard
2,238
ºÎ¸ðdom ÀÇ ³ÐÀÌ¿¡ µû¶ó ÀÚµ¿À¸·Î ³ÐÀÌ Á¶ÀýÇϱâ
2,237
3D ÀÔü °¶·¯¸® (¹Ù¶÷°³ºñ ´À³¦) »ó,ÇÏ,ÁÂ,¿ì µå·¡±× °¡´É
2,236
3D ÀÔü °¶·¯¸®
2,235
¾ÆÀÌÆù, ¾Èµå·ÎÀÌµå ¹ÙÅÁÈ­¸é¿¡ ¹Ù·Î°¡±â ¸¸µé±â
2,234
À¥È£½ºÆà ÀÌ¿ëÀÚ°¡ ¾÷·Îµå ¿ë·® ´Ã¸®±â
2,233
À̹ÌÁö°¡ Ŭ °æ¿ì Å×À̺íÀÌ ´Ã¾î³µ´Ù°¡ ÁÙ¾îµé¶§
2,232
cut - ¹®ÀÚ¿­ ÀÚ¸£±â
2,231
PHP ÄÚµù ½ºÅ¸ÀÏ
2,230
±¹³»IP Á¤º¸ Á¶È¸Çϴ Ŭ·¡½º(php)
2,229
php->xml »ý¼ºÇÏ´Â class
socketÀÌ¿ëÇÑ Å¸»çÀÌÆ® À̹ÌÁö Àбâ
2,227
»çÀÌÁî°¡ Å«À̹ÌÁö À¥ÆäÀÌÁö Ãâ·Â½Ã ÀÚµ¿À¸·Î »çÀÌÁî ÁÙÀ̱â...
2,226
php·Î ÀÛ¼ºÇÑ °£´Ü RSS2.0 ¸®´õ
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.