array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.pg-lo-tell.php', 1 => 'pg_lo_tell', ), 'up' => array ( 0 => 'ref.pgsql.php', 1 => 'PostgreSQL 函数', ), 'prev' => array ( 0 => 'function.pg-lo-seek.php', 1 => 'pg_lo_seek', ), 'next' => array ( 0 => 'function.pg-lo-truncate.php', 1 => 'pg_lo_truncate', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/pgsql/functions/pg-lo-tell.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
pg_lo_tell — 返回当前大型对象的指针位置
当前查找距离大对象开头的偏移量(字节数)。如果有错误,返回值为负。
示例 #1 pg_lo_tell() 示例
<?php
$doc_oid = 189762345;
$database = pg_connect("dbname=jacarta");
pg_query($database, "begin");
$handle = pg_lo_open($database, $doc_oid, "r");
// 忽略开始的 50000 字节
pg_lo_seek($handle, 50000, PGSQL_SEEK_SET);
// 查看忽略了多少
$offset = pg_lo_tell($handle);
echo "Seek position is: $offset";
pg_query($database, "commit");
?>
以上示例会输出:
Seek position is: 50000