본문 바로가기

타쿠꺼

검색하기
타쿠꺼
프로필사진 kimtaku

  • 분류 전체보기 (71)
    • Daily Study (13)
    • Web Study (12)
    • ETC. (3)
    • HTML (4)
      • Study (0)
      • Reference (3)
      • Problem (1)
    • CSS (14)
      • Study (6)
      • Reference (7)
      • Problem (1)
    • Javascript (16)
      • Study (11)
      • Reference (5)
      • Problem (0)
    • jQuery (3)
      • Study (2)
      • Reference (1)
      • Problem (0)
    • PHP (0)
    • Book (1)
    • Font (4)
      • Korean (1)
      • English (3)
      • etc (0)
    • Brackets (1)
    • Skin (0)
      • Data (0)
    • Photoshop (0)
    • Illustrator (0)
Guestbook
Notice
Recent Posts
Recent Comments
Link
  • 문스토리
«   2016/07   »
일 월 화 수 목 금 토
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Tags
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록2016/07/31 (1)

타쿠꺼

allow_url_fopen = 0일 때 Simple HTML DOM Parser 사용하기

대부분 호스팅 사이트는 보안의 이유로 allow_url_fopen = 0으로 설정되어 있어서 file_get_contents 을 비롯한 여러 함수가 사용이 불가능하다. 따라서 이 함수를 사용하는 Simple HTML DOM Parser를 사용 못하는데, 이 때 cURL 라이브러리를 이용하면 된다.cURL 라이브러리는 php에 보통 내장되어 있으므로 대부분 사용 가능하다. 아래의 코드를 Simple HTML DOM Parser의 $contents = file_get_contents( ... ); 대신에 사용한다. 123456$curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, ..

ETC. 2016. 7. 31. 00:18
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바