ㅁ PHP 에서 url 가져오는 방법 2가지
1. 우선 file_get_contents() 를 이용해서 url 가져오는 구문
<?php
$url = 'http://server.com/path';
$data = array('key1' => 'value1', 'key2' => 'value2');
// use key 'http' even if you send the request to https://...
$options = array('http' => array(
'method' => 'POST',
'content' => http_build_query($data)
));
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
var_dump($result);
'개발' 카테고리의 다른 글
input type=text 에서 한글/영문 입력값 제한하기 (2) | 2015.07.06 |
---|---|
PHP 에서 서버변수인 PHP_SELF SCRIPT_NAME REQUEST_URI 차이점 (0) | 2015.06.28 |
PHP 에서 file_get_contents 와 cURL 의 차이점 및 장단점 (0) | 2015.05.04 |
Google reCAPTCHA 를 사용하기 위해 도메인 등록하고 Site Key 를 얻는 방법 (0) | 2015.05.01 |
jQuery 에서 document ready와 window load의 차이 (0) | 2015.04.29 |