PHP

    file_get_contents
    • 조회수 5,261
    • 작성일 2009-03-31
    •  
    string file_get_contents ( string $filename [, int $flags= 0 [, resource $context [, int $offset= -1 [, int $maxlen= -1 ]]]] )

    파일을 문자열로 읽어오는 것을 제외하고 file() 함수와 같다.
    offset과 maxlen이 지정되면 파일의 offset번째 바이트부터 maxlen의 바이트 길이만큼
    읽어온다.

    • Comment 2009-03-31
    대다수의 웹호스팅 업체에서는 file_get_contents 함수를 막아놓아서 사용할 수 없습니다. 코로케이션 서버를 이용하거나 단독 서버를 사용할 경우 개별적인 설정으로만 사용할 수 있습니다.
    • Comment 2019-04-02
    $input = file_get_contents('php://input', 1000000); $value = json_decode($input); echo $value->partner;