Forum und email
Data (RFC 2397)

Data (RFC 2397)

The data: (RFC 2397) stream wrapper is available since PHP 5.2.0.

Příklad N-4. Print data:// contents

// prints "I love PHP"
echo file_get_contents('data://text/plain;base64,SSBsb3ZlIFBIUAo=');

Příklad N-5. Fetch the media type

= fopen('data://text/plain;base64,', 'r');
$meta = stream_get_meta_data($fp);

// prints "text/plain"
echo $meta['mediatype'];

Tabulka N-8. Wrapper Summary

Restricted by allow_url_fopenNo
Restricted by allow_url_includeYes
Allows ReadingYes
Allows WritingNo
Allows AppendingNo
Allows Simultaneous Reading and WritingNo
Supports stat()No
Supports unlink()No
Supports rename()No
Supports mkdir()No
Supports rmdir()No