略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: pg_lo_tell

2024-11-13

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

add a noteadd a note

User Contributed Notes 1 note

up
0
Marv-CZ
11 years ago
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;
}
?>

官方地址:https://www.php.net/manual/en/function.pg-lo-tell.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3