Zip 函数
php 手册 | 脚本学堂 | 脚本编程 | 网站编程 | 系统管理 | 服务器配置 | 数据库管理 | Php教程 | python教程 | 正则表达式 | 批处理脚本 | Centos教程 | Linux基础教程

ZipArchive::renameIndex

(PHP 5 >= 5.2.0, PECL zip >= 1.5.0)

ZipArchive::renameIndexRenames an entry defined by its index

说明

bool ZipArchive::renameIndex ( int $index , string $newname )

Renames an entry defined by its index.

参数

index

Index of the entry to rename.

newname

New name.

返回值

如果成功则返回 TRUE,失败则返回 FALSE

范例

Example #1 Rename one entry

<?php
$zip 
= new ZipArchive;
$res $zip->open('test.zip')
if (
$res === TRUE) {
    
$zip->renameIndex(2,'newname.txt');
    
$zip->close();
} else {
    echo 
'failed, code:' $res;
}
?>

Zip 函数
php 手册 | 脚本学堂 | 脚本编程 | 网站编程 | 系统管理 | 服务器配置 | 数据库管理 | Php教程 | python教程 | 正则表达式 | 批处理脚本 | Centos教程 | Linux基础教程