data://

Data (RFC 2397)

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

Examples:
Print data:// contents
<?php
// prints "I love PHP"
echo file_get_contents('data://text/plain;base64,SSBsb3ZlIFBIUAo=');
?>

Fetch the media type
<?php
$fp   = fopen('data://text/plain;base64,', 'r');
$meta = stream_get_meta_data($fp);

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

doc_php
2016-02-24 15:53:22
Comments
Leave a Comment

Please login to continue.