pg_lo_tell

(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)

pg_lo_tell 返回大型对象的当前指针位置

说明

pg_lo_tell ( resource $large_object ) : int

pg_lo_tell() 返回当前指针位置(大型对象中从头开始的偏移量)。

参见 pg_lo_seek()

User Contributed Notes

Marv-CZ 15-Nov-2010 10:26
Function to take a large object size:

<?php
function pg_lo_size ($lo) {
 
$pos = pg_lo_tell ($lo);
 
pg_lo_seek ($lo, 0, PGSQL_SEEK_END);
 
$size = pg_lo_tell ($lo);
 
pg_lo_seek ($lo, $pos, PGSQL_SEEK_SET);
  return
$size;
}
?>
PHP8中文手册 站长在线 整理 版权归PHP文档组所有