<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Set the encryption method of an entry defined by its index</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ziparchive.setcompressionname.html">ZipArchive::setCompressionName</a></div> <div class="next" style="text-align: right; float: right;"><a href="ziparchive.setencryptionname.html">ZipArchive::setEncryptionName</a></div> <div class="up"><a href="class.ziparchive.html">ZipArchive</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="ziparchive.setencryptionindex" class="refentry"> <div class="refnamediv"> <h1 class="refname">ZipArchive::setEncryptionIndex</h1> <p class="verinfo">(PHP >= 7.2.0, PECL zip >= 1.14.0)</p><p class="refpurpose"><span class="refname">ZipArchive::setEncryptionIndex</span> — <span class="dc-title">Set the encryption method of an entry defined by its index</span></p> </div> <div class="refsect1 description" id="refsect1-ziparchive.setencryptionindex-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><strong>ZipArchive::setEncryptionIndex</strong></span> ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$index</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$method</code></span> [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$password</code></span> ] )</div> <p class="para rdfs-comment"> Set the encryption method of an entry defined by its index. </p> </div> <div class="refsect1 parameters" id="refsect1-ziparchive.setencryptionindex-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <code class="parameter">index</code></dt> <dd> <p class="para"> Index of the entry. </p> </dd> <dt> <code class="parameter">method</code></dt> <dd> <p class="para"> The encryption method defined by one of the ZipArchive::EM_ constants. </p> </dd> <dt> <code class="parameter">password</code></dt> <dd> <p class="para"> Optional password, default used when missing. </p> </dd> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-ziparchive.setencryptionindex-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure. </p> </div> <div class="refsect1 seealso" id="refsect1-ziparchive.setencryptionindex-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><span class="methodname"><a href="ziparchive.setpassword.html" class="methodname" rel="rdfs-seeAlso">ZipArchive::setPassword()</a> - Set the password for the active archive</span></li> <li class="member"><span class="methodname"><a href="ziparchive.setencryptionname.html" class="methodname" rel="rdfs-seeAlso">ZipArchive::setEncryptionName()</a> - Set the encryption method of an entry defined by its name</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ziparchive.setcompressionname.html">ZipArchive::setCompressionName</a></div> <div class="next" style="text-align: right; float: right;"><a href="ziparchive.setencryptionname.html">ZipArchive::setEncryptionName</a></div> <div class="up"><a href="class.ziparchive.html">ZipArchive</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>