public function put($source = 'php://input', $sanitize = true)
    {
        if (is_null($source)) {
            $source = 'php://input';
        }

        $source = @fopen($source, 'r');

        if (!is_resource($source)) {
            throw new InvalidArgumentException('Expected parameter 1 to be an open-able resource');
        }

        $data = null;

        while ($buffer = fread($source, 1024)) {
            $data .= $buffer;
        }

        fclose($source);

        return $sanitize ? filter_var($data, FILTER_SANITIZE_STRING) : $data;
    }
public function put($source = 'php://input', $sanitize = true)
    {
        if (is_null($source)) {
            $source = 'php://input';
        }

        $source = @fopen($source, 'r');

        if (!is_resource($source)) {
            throw new InvalidArgumentException('Expected parameter 1 to be an open-able resource');
        }

        $data = null;

        while ($buffer = fread($source, 1024)) {
            $data .= $buffer;
        }

        fclose($source);

        return $sanitize ? filter_var($data, FILTER_SANITIZE_STRING) : $data;
    }
public function put ( $ source = 'php://input' , $ sanitize = true ) { if ( is_null ( $ source ) ) { $ source = 'php://input' ; } $ source = @ fopen ( $ source , 'r' ) ; if ( ! is_resource ( $ source ) ) { throw new InvalidArgumentException ( 'Expected parameter 1 to be an open-able resource' ) ; } $ data = null ; while ( $ buffer = fread ( $ source , 1024 ) ) { $ data .= $ buffer ; } fclose ( $ source ) ; return $ sanitize ? filter_var ( $ data , FILTER_SANITIZE_STRING ) : $ data ; }
Retrieve date from the input stream

@param string $source (Default: 'php://input')
@param bool   $sanitize

@throws \InvalidArgumentException
@return mixed
Retrieve date from the input stream