MongoGridFSFile::getBytes

(PECL mongo >=0.9.0)

MongoGridFSFile::getBytesReturns this file's contents as a string of bytes

说明

public MongoGridFSFile::getBytes ( void ) : string

Warning: this will load the file into memory. If the file is bigger than your memory, this will cause problems!

参数

此函数没有参数。

返回值

Returns a string of the bytes in the file.

范例

Example #1 MongoGridFSFile::getBytes() example

<?php

$images 
$db->my_db->getGridFS('images');

$image $images->findOne('jwage.png');

header('Content-type: image/png;');
echo 
$image->getBytes();
?>
相关文章
php ktaglib mpeg audioproperties returns if protection mechanisms of an mpeg file are enabledphp eventbuffer linearizes data within buffer and returns it s contents as a stringphp ibm db2 函数 returns a string containing the sqlstate returned by the last connection attemptphp 多字节字符串 函数 returns position and length of a matched part of the multibyte regular expression for a predefined multibyte stringphp svn 函数 returns the contents of a file in a repositoryphp svn 函数 returns a stream to access the contents of a file from a given version of the fsphp gearmanclient returns an error string for the last error encounteredphp gmagick returns the gmagick quantum depth as a stringphp mongodb bson utcdatetimeinterface returns the string representation of this utcdatetimeinterfacephp mongogridfsfile returns this file s contents as a string of bytesphp mongogridfsfile returns this file s filenamephp mongogridfsfile returns a resource that can be used to read the stored filephp mongogridfsfile returns this file s sizephp ktaglib mpeg file returns an object that provides access to the audio propertiesphp ktaglib mpeg file returns an object representing an id3v1 tagphp ktaglib mpeg file returns a id3v2 objectphp normalizer normalizes the input provided and returns the normalized stringphp phardata set the contents of a file within the tar/zip to those of an external file or stringphp sdo das xml 函数 returns root element s uri stringphp splfileinfo returns the path to the file as a string
关注编程学问公众号