
ZipArchive::unchangeIndex 함수는 압축 파일의 인덱스를 변경한 후, 변경된 인덱스를 반영하는 데 사용됩니다.
압축 파일의 인덱스를 변경한 후, 다시 압축 파일을 열었을 때, 변경된 인덱스가 반영되는지 확인할 수 있는 방법은 다음과 같습니다.
1. 변경된 인덱스를 확인하기 위해, ZipArchive::getExternalAttributes 함수를 사용할 수 있습니다. 이 함수는 압축 파일의 인덱스를 반환합니다.
2. 변경된 인덱스를 확인하기 위해, ZipArchive::getExternalAttributesName 함수를 사용할 수 있습니다. 이 함수는 압축 파일의 인덱스 이름을 반환합니다.
ZipArchive::unchangeIndex 함수의 사용 예제 코드는 다음과 같습니다.
#hostingforum.kr
php
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
$zip->addFile('example.txt');
$index = $zip->chdir('example.txt');
$zip->unchangeIndex($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
이 예제 코드는 'example.zip' 압축 파일을 열고, 'example.txt' 파일을 추가한 후, 인덱스를 변경하고, 변경된 인덱스를 반영합니다.
압축 파일의 인덱스를 변경한 후, 다시 압축 파일을 열었을 때, 변경된 인덱스가 반영되는지 확인할 수 있습니다.
#hostingforum.kr
php
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
$index = $zip->chdir('example.txt');
$zip->unchangeIndex($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
echo $zip->getExternalAttributes($index);
echo $zip->getExternalAttributesName($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
이 예제 코드는 압축 파일을 열고, 인덱스를 변경한 후, 다시 압축 파일을 열었을 때, 변경된 인덱스가 반영되는지 확인합니다.
#hostingforum.kr
php
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
$index = $zip->chdir('example.txt');
$zip->unchangeIndex($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
echo $zip->getExternalAttributes($index);
echo $zip->getExternalAttributesName($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
이 예제 코드는 압축 파일의 인덱스를 변경한 후, 다시 압축 파일을 열었을 때, 변경된 인덱스가 반영되는지 확인합니다.
#hostingforum.kr
php
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
$index = $zip->chdir('example.txt');
$zip->unchangeIndex($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
echo $zip->getExternalAttributes($index);
echo $zip->getExternalAttributesName($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
이 예제 코드는 압축 파일의 인덱스를 변경한 후, 다시 압축 파일을 열었을 때, 변경된 인덱스가 반영되는지 확인합니다.
#hostingforum.kr
php
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
$index = $zip->chdir('example.txt');
$zip->unchangeIndex($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
echo $zip->getExternalAttributes($index);
echo $zip->getExternalAttributesName($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
이 예제 코드는 압축 파일의 인덱스를 변경한 후, 다시 압축 파일을 열었을 때, 변경된 인덱스가 반영되는지 확인합니다.
#hostingforum.kr
php
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
$index = $zip->chdir('example.txt');
$zip->unchangeIndex($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
echo $zip->getExternalAttributes($index);
echo $zip->getExternalAttributesName($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
이 예제 코드는 압축 파일의 인덱스를 변경한 후, 다시 압축 파일을 열었을 때, 변경된 인덱스가 반영되는지 확인합니다.
#hostingforum.kr
php
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
$index = $zip->chdir('example.txt');
$zip->unchangeIndex($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
echo $zip->getExternalAttributes($index);
echo $zip->getExternalAttributesName($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
이 예제 코드는 압축 파일의 인덱스를 변경한 후, 다시 압축 파일을 열었을 때, 변경된 인덱스가 반영되는지 확인합니다.
#hostingforum.kr
php
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
$index = $zip->chdir('example.txt');
$zip->unchangeIndex($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
echo $zip->getExternalAttributes($index);
echo $zip->getExternalAttributesName($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
이 예제 코드는 압축 파일의 인덱스를 변경한 후, 다시 압축 파일을 열었을 때, 변경된 인덱스가 반영되는지 확인합니다.
#hostingforum.kr
php
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
$index = $zip->chdir('example.txt');
$zip->unchangeIndex($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
echo $zip->getExternalAttributes($index);
echo $zip->getExternalAttributesName($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
이 예제 코드는 압축 파일의 인덱스를 변경한 후, 다시 압축 파일을 열었을 때, 변경된 인덱스가 반영되는지 확인합니다.
#hostingforum.kr
php
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
$index = $zip->chdir('example.txt');
$zip->unchangeIndex($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
echo $zip->getExternalAttributes($index);
echo $zip->getExternalAttributesName($index);
$zip->close();
} else {
echo '파일을 열 수 없습니다.';
}
이 예제 코드는 압축 파일의 인덱스를 변경한 후, 다시 압축 파일을 열었을 때, 변경된 인덱스가 반영되는지 확인합니다.
```php
$zip = new ZipArchive;
if ($zip->open('example.zip', ZipArchive::CREATE) === TRUE) {
$index = $zip->chdir('example.txt
2025-08-16 00:22