curl에대해..궁굼합니다. 채택완료
주니1
10년 전
조회 4,300
화일을 utf-8로 가져오고 싶은데..EUC-KR로 되네요
파일속성을 EUTF-8로 하려면 어떻게 해야 하나요?
$ch = curl_init("http://www.com.php">www.com.php");
$fp = fopen("schedule.csv", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_ENCODING , "UTF-8");
curl_exec($ch);
curl_close($ch);
$ch= iconv("EUC-KR","UTF-8", $ch);
fclose($fp);
?>
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
채택된 답변
+20 포인트
10년 전
이렇게 한번 해보세요.
저도 되는지 안되는지 잘 모르겠네요.
구글링한 결과
</p><p><span style="font-family: gulim, helvetica; font-size: 13.0799999237061px; line-height: 23.5440006256104px; background-color: rgb(255, 255, 255);"><?php</span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);">$ch = curl_init("<a href="<a href="http://www.com.php/" target="_blank" rel="noopener noreferrer">http://www.com.php/</a>" target="_blank" style="color: rgb(0, 0, 0);">www.com.php</a>"); </p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);">$fp = fopen("schedule.csv", "w");</p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);">fwrite($fp, pack("CCC", 0xef, 0xbb, 0xbf));</p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span style="font-size: 13.0799999237061px; line-height: 23.5440006256104px;">curl_setopt($ch, CURLOPT_FILE, $fp); </span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);">curl_setopt($ch, CURLOPT_HEADER, 1); </p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);">//curl_setopt($ch, CURLOPT_ENCODING , "UTF-8"); </p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);">curl_exec($ch); </p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);">curl_close($ch); </p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; font-size: 13.0799999237061px; background-color: rgb(255, 255, 255);"><span style="font-size: 13.0799999237061px; line-height: 23.5440006256104px;">fclose($fp); </span></p><p><span style="font-family: gulim, helvetica; font-size: 13.0799999237061px; line-height: 23.5440006256104px; background-color: rgb(255, 255, 255);">?></span> </p><p><span style="font-family: gulim, helvetica; font-size: 13.0799999237061px; line-height: 23.5440006256104px; background-color: rgb(255, 255, 255);">
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인