php教程

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();
?>

User Contributed Notes

There are no user contributed notes for this page.

CopyRight © 2008-2022 verySource.Com All Rights reserved. 京ICP备17048824号-1 京公网安备:11010502034788