<strings>
<string id="zlib_get_coding_type" value="<div id='function.zlib-get-coding-type' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.zlib-get-coding-type.php'>zlib_get_coding_type</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.3.2, PHP 5)</p><p class='refpurpose'><span class='refname'>zlib_get_coding_type</span> &amp;mdash; <span class='dc-title'>Returns the coding type used for output compression</span></p> </div> <a name='function.zlib-get-coding-type.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>zlib_get_coding_type</b></span> ( <span class='methodparam'>void</span> )</div> <p class='para rdfs-comment'> Returns the coding type used for output compression. </p> </div> <a name='function.zlib-get-coding-type.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Possible return values are <i>gzip</i>, <i>deflate</i>, or <b><tt class='constant'>FALSE</tt></b>. </p> </div> <a name='function.zlib-get-coding-type.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'> The <a href='http://www.php.net/manual/en/zlib.configuration.php#ini.zlib.output-compression' class='link'>zlib.output_compression</a> directive </li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="zip_read" value="<div id='function.zip-read' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.zip-read.php'>zip_read</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.1.0, PHP 5 &amp;gt;= 5.2.0, PECL zip &amp;gt;= 1.0.0)</p><p class='refpurpose'><span class='refname'>zip_read</span> &amp;mdash; <span class='dc-title'>Read next entry in a ZIP file archive</span></p> </div> <a name='function.zip-read.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <span class='methodname'><b>zip_read</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zip</tt></span> )</div> <p class='para rdfs-comment'> Reads the next entry in a zip file archive. </p> </div> <a name='function.zip-read.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zip</tt></i> </span> </dt><dd class='listitem'> <p class='para'> A ZIP file previously opened with <a href='http://www.php.net/manual/en/function.zip-open.php' class='function'>zip_open()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.zip-read.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns a directory entry resource for later use with the <i>zip_entry_...</i> functions or <b><tt class='constant'>FALSE</tt></b> if there&amp;#039;s no more entries to read or number of error in case of other error. </p> </div> <a name='function.zip-read.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.zip-open.php' class='function' rel='rdfs-seeAlso'>zip_open()</a> - Open a ZIP file archive</li> <li class='member'><a href='http://www.php.net/manual/en/function.zip-close.php' class='function' rel='rdfs-seeAlso'>zip_close()</a> - Close a ZIP file archive</li> <li class='member'><a href='http://www.php.net/manual/en/function.zip-entry-open.php' class='function' rel='rdfs-seeAlso'>zip_entry_open()</a> - Open a directory entry for reading</li> <li class='member'><a href='http://www.php.net/manual/en/function.zip-entry-read.php' class='function' rel='rdfs-seeAlso'>zip_entry_read()</a> - Read from an open directory entry</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="zip_open" value="<div id='function.zip-open' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.zip-open.php'>zip_open</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.1.0, PHP 5 &amp;gt;= 5.2.0, PECL zip &amp;gt;= 1.0.0)</p><p class='refpurpose'><span class='refname'>zip_open</span> &amp;mdash; <span class='dc-title'>Open a ZIP file archive</span></p> </div> <a name='function.zip-open.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <span class='methodname'><b>zip_open</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$filename</tt></span> )</div> <p class='para rdfs-comment'> Opens a new zip archive for reading. </p> </div> <a name='function.zip-open.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>filename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The file name of the ZIP archive to open. </p> </dd> </dl> <p> </p> </div> <a name='function.zip-open.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns a resource handle for later use with <a href='http://www.php.net/manual/en/function.zip-read.php' class='function'>zip_read()</a> and <a href='http://www.php.net/manual/en/function.zip-close.php' class='function'>zip_close()</a> or returns the number of error if <i><tt class='parameter'>filename</tt></i> does not exist or in case of other error. </p> </div> <a name='function.zip-open.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.zip-read.php' class='function' rel='rdfs-seeAlso'>zip_read()</a> - Read next entry in a ZIP file archive</li> <li class='member'><a href='http://www.php.net/manual/en/function.zip-close.php' class='function' rel='rdfs-seeAlso'>zip_close()</a> - Close a ZIP file archive</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="zip_entry_read" value="<div id='function.zip-entry-read' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.zip-entry-read.php'>zip_entry_read</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.1.0, PHP 5 &amp;gt;= 5.2.0, PECL zip &amp;gt;= 1.0.0)</p><p class='refpurpose'><span class='refname'>zip_entry_read</span> &amp;mdash; <span class='dc-title'>Read from an open directory entry</span></p> </div> <a name='function.zip-entry-read.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>zip_entry_read</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zip_entry</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$length</tt></span> ] )</div> <p class='para rdfs-comment'> Reads from an open directory entry. </p> </div> <a name='function.zip-entry-read.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zip_entry</tt></i> </span> </dt><dd class='listitem'> <p class='para'> A directory entry returned by <a href='http://www.php.net/manual/en/function.zip-read.php' class='function'>zip_read()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>length</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The number of bytes to return. If not specified, this function will attempt to read 1024 bytes. </p> <blockquote><p><b class='note'>Note</b>: This should be the uncompressed length you wish to read. <br /> </p></blockquote> </dd> </dl> <p> </p> </div> <a name='function.zip-entry-read.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the data read, or <b><tt class='constant'>FALSE</tt></b> if the end of the file is reached. </p> </div> <a name='function.zip-entry-read.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.zip-entry-open.php' class='function' rel='rdfs-seeAlso'>zip_entry_open()</a> - Open a directory entry for reading</li> <li class='member'><a href='http://www.php.net/manual/en/function.zip-entry-close.php' class='function' rel='rdfs-seeAlso'>zip_entry_close()</a> - Close a directory entry</li> <li class='member'><a href='http://www.php.net/manual/en/function.zip-entry-filesize.php' class='function' rel='rdfs-seeAlso'>zip_entry_filesize()</a> - Retrieve the actual file size of a directory entry</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="zip_entry_open" value="<div id='function.zip-entry-open' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.zip-entry-open.php'>zip_entry_open</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.1.0, PHP 5 &amp;gt;= 5.2.0, PECL zip &amp;gt;= 1.0.0)</p><p class='refpurpose'><span class='refname'>zip_entry_open</span> &amp;mdash; <span class='dc-title'>Open a directory entry for reading</span></p> </div> <a name='function.zip-entry-open.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>zip_entry_open</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zip</tt></span> , <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zip_entry</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$mode</tt></span> ] )</div> <p class='para rdfs-comment'> Opens a directory entry in a zip file for reading. </p> </div> <a name='function.zip-entry-open.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zip</tt></i> </span> </dt><dd class='listitem'> <p class='para'> A valid resource handle returned by <a href='http://www.php.net/manual/en/function.zip-open.php' class='function'>zip_open()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zip_entry</tt></i> </span> </dt><dd class='listitem'> <p class='para'> A directory entry returned by <a href='http://www.php.net/manual/en/function.zip-read.php' class='function'>zip_read()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>mode</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Any of the modes specified in the documentation of <a href='http://www.php.net/manual/en/function.fopen.php' class='function'>fopen()</a>. </p> <blockquote><p><b class='note'>Note</b>: Currently, <i><tt class='parameter'>mode</tt></i> is ignored and is always <i>&amp;quot;rb&amp;quot;</i>. This is due to the fact that zip support in PHP is read only access. <br /> </p></blockquote> </dd> </dl> <p> </p> </div> <a name='function.zip-entry-open.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> <blockquote><p><b class='note'>Note</b>: Unlike <a href='http://www.php.net/manual/en/function.fopen.php' class='function'>fopen()</a> and other similar functions, the return value of <b>zip_entry_open()</b> only indicates the result of the operation and is not needed for reading or closing the directory entry. <br /> </p></blockquote> </div> <a name='function.zip-entry-open.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.zip-entry-close.php' class='function' rel='rdfs-seeAlso'>zip_entry_close()</a> - Close a directory entry</li> <li class='member'><a href='http://www.php.net/manual/en/function.zip-entry-read.php' class='function' rel='rdfs-seeAlso'>zip_entry_read()</a> - Read from an open directory entry</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="zip_entry_name" value="<div id='function.zip-entry-name' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.zip-entry-name.php'>zip_entry_name</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.1.0, PHP 5 &amp;gt;= 5.2.0, PECL zip &amp;gt;= 1.0.0)</p><p class='refpurpose'><span class='refname'>zip_entry_name</span> &amp;mdash; <span class='dc-title'>Retrieve the name of a directory entry</span></p> </div> <a name='function.zip-entry-name.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>zip_entry_name</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zip_entry</tt></span> )</div> <p class='para rdfs-comment'> Returns the name of the specified directory entry. </p> </div> <a name='function.zip-entry-name.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zip_entry</tt></i> </span> </dt><dd class='listitem'> <p class='para'> A directory entry returned by <a href='http://www.php.net/manual/en/function.zip-read.php' class='function'>zip_read()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.zip-entry-name.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The name of the directory entry. </p> </div> <a name='function.zip-entry-name.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.zip-open.php' class='function' rel='rdfs-seeAlso'>zip_open()</a> - Open a ZIP file archive</li> <li class='member'><a href='http://www.php.net/manual/en/function.zip-read.php' class='function' rel='rdfs-seeAlso'>zip_read()</a> - Read next entry in a ZIP file archive</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="zip_entry_filesize" value="<div id='function.zip-entry-filesize' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.zip-entry-filesize.php'>zip_entry_filesize</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.1.0, PHP 5 &amp;gt;= 5.2.0, PECL zip &amp;gt;= 1.0.0)</p><p class='refpurpose'><span class='refname'>zip_entry_filesize</span> &amp;mdash; <span class='dc-title'>Retrieve the actual file size of a directory entry</span></p> </div> <a name='function.zip-entry-filesize.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>zip_entry_filesize</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zip_entry</tt></span> )</div> <p class='para rdfs-comment'> Returns the actual size of the specified directory entry. </p> </div> <a name='function.zip-entry-filesize.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zip_entry</tt></i> </span> </dt><dd class='listitem'> <p class='para'> A directory entry returned by <a href='http://www.php.net/manual/en/function.zip-read.php' class='function'>zip_read()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.zip-entry-filesize.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The size of the directory entry. </p> </div> <a name='function.zip-entry-filesize.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.zip-open.php' class='function' rel='rdfs-seeAlso'>zip_open()</a> - Open a ZIP file archive</li> <li class='member'><a href='http://www.php.net/manual/en/function.zip-read.php' class='function' rel='rdfs-seeAlso'>zip_read()</a> - Read next entry in a ZIP file archive</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="zip_entry_compressionmethod" value="<div id='function.zip-entry-compressionmethod' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.zip-entry-compressionmethod.php'>zip_entry_compressionmethod</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.1.0, PHP 5 &amp;gt;= 5.2.0, PECL zip &amp;gt;= 1.0.0)</p><p class='refpurpose'><span class='refname'>zip_entry_compressionmethod</span> &amp;mdash; <span class='dc-title'>Retrieve the compression method of a directory entry</span></p> </div> <a name='function.zip-entry-compressionmethod.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>zip_entry_compressionmethod</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zip_entry</tt></span> )</div> <p class='para rdfs-comment'> Returns the compression method of the directory entry specified by <i><tt class='parameter'>zip_entry</tt></i> . </p> </div> <a name='function.zip-entry-compressionmethod.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zip_entry</tt></i> </span> </dt><dd class='listitem'> <p class='para'> A directory entry returned by <a href='http://www.php.net/manual/en/function.zip-read.php' class='function'>zip_read()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.zip-entry-compressionmethod.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The compression method. </p> </div> <a name='function.zip-entry-compressionmethod.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.zip-open.php' class='function' rel='rdfs-seeAlso'>zip_open()</a> - Open a ZIP file archive</li> <li class='member'><a href='http://www.php.net/manual/en/function.zip-read.php' class='function' rel='rdfs-seeAlso'>zip_read()</a> - Read next entry in a ZIP file archive</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="zip_entry_compressedsize" value="<div id='function.zip-entry-compressedsize' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.zip-entry-compressedsize.php'>zip_entry_compressedsize</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.1.0, PHP 5 &amp;gt;= 5.2.0, PECL zip &amp;gt;= 1.0.0)</p><p class='refpurpose'><span class='refname'>zip_entry_compressedsize</span> &amp;mdash; <span class='dc-title'>Retrieve the compressed size of a directory entry</span></p> </div> <a name='function.zip-entry-compressedsize.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>zip_entry_compressedsize</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zip_entry</tt></span> )</div> <p class='para rdfs-comment'> Returns the compressed size of the specified directory entry. </p> </div> <a name='function.zip-entry-compressedsize.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zip_entry</tt></i> </span> </dt><dd class='listitem'> <p class='para'> A directory entry returned by <a href='http://www.php.net/manual/en/function.zip-read.php' class='function'>zip_read()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.zip-entry-compressedsize.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The compressed size. </p> </div> <a name='function.zip-entry-compressedsize.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.zip-open.php' class='function' rel='rdfs-seeAlso'>zip_open()</a> - Open a ZIP file archive</li> <li class='member'><a href='http://www.php.net/manual/en/function.zip-read.php' class='function' rel='rdfs-seeAlso'>zip_read()</a> - Read next entry in a ZIP file archive</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="zip_entry_close" value="<div id='function.zip-entry-close' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.zip-entry-close.php'>zip_entry_close</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.1.0, PHP 5 &amp;gt;= 5.2.0, PECL zip &amp;gt;= 1.0.0)</p><p class='refpurpose'><span class='refname'>zip_entry_close</span> &amp;mdash; <span class='dc-title'>Close a directory entry</span></p> </div> <a name='function.zip-entry-close.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>zip_entry_close</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zip_entry</tt></span> )</div> <p class='para rdfs-comment'> Closes the specified directory entry. </p> </div> <a name='function.zip-entry-close.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zip_entry</tt></i> </span> </dt><dd class='listitem'> <p class='para'> A directory entry previously opened <a href='http://www.php.net/manual/en/function.zip-entry-open.php' class='function'>zip_entry_open()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.zip-entry-close.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.zip-entry-close.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.zip-entry-open.php' class='function' rel='rdfs-seeAlso'>zip_entry_open()</a> - Open a directory entry for reading</li> <li class='member'><a href='http://www.php.net/manual/en/function.zip-entry-read.php' class='function' rel='rdfs-seeAlso'>zip_entry_read()</a> - Read from an open directory entry</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="zip_close" value="<div id='function.zip-close' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.zip-close.php'>zip_close</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.1.0, PHP 5 &amp;gt;= 5.2.0, PECL zip &amp;gt;= 1.0.0)</p><p class='refpurpose'><span class='refname'>zip_close</span> &amp;mdash; <span class='dc-title'>Close a ZIP file archive</span></p> </div> <a name='function.zip-close.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'><span class='type void'>void</span></span> <span class='methodname'><b>zip_close</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zip</tt></span> )</div> <p class='para rdfs-comment'> Closes the given ZIP file archive. </p> </div> <a name='function.zip-close.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zip</tt></i> </span> </dt><dd class='listitem'> <p class='para'> A ZIP file previously opened with <a href='http://www.php.net/manual/en/function.zip-open.php' class='function'>zip_open()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.zip-close.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> No value is returned. </p> </div> <a name='function.zip-close.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.zip-open.php' class='function' rel='rdfs-seeAlso'>zip_open()</a> - Open a ZIP file archive</li> <li class='member'><a href='http://www.php.net/manual/en/function.zip-read.php' class='function' rel='rdfs-seeAlso'>zip_read()</a> - Read next entry in a ZIP file archive</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="readgzfile" value="<div id='function.readgzfile' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.readgzfile.php'>readgzfile</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>readgzfile</span> &amp;mdash; <span class='dc-title'>Output a gz-file</span></p> </div> <a name='function.readgzfile.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>readgzfile</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$filename</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$use_include_path</tt><span class='initializer'> = 0</span></span> ] )</div> <p class='para rdfs-comment'> Reads a file, decompresses it and writes it to standard output. </p> <p class='para'> <b>readgzfile()</b> can be used to read a file which is not in gzip format; in this case <b>readgzfile()</b> will directly read from the file without decompression. </p> </div> <a name='function.readgzfile.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>filename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The file name. This file will be opened from the filesystem and its contents written to standard output. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>use_include_path</tt></i> </span> </dt><dd class='listitem'> <p class='para'> You can set this optional parameter to <i>1</i>, if you want to search for the file in the <a href='http://www.php.net/manual/en/ini.core.php#ini.include-path' class='link'>include_path</a> too. </p> </dd> </dl> <p> </p> </div> <a name='function.readgzfile.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the number of (uncompressed) bytes read from the file. If an error occurs, <b><tt class='constant'>FALSE</tt></b> is returned and unless the function was called as <i>@readgzfile</i>, an error message is printed. </p> </div> <a name='function.readgzfile.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.gzpassthru.php' class='function' rel='rdfs-seeAlso'>gzpassthru()</a> - Output all remaining data on a gz-file pointer</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzfile.php' class='function' rel='rdfs-seeAlso'>gzfile()</a> - Read entire gz-file into an array</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzopen.php' class='function' rel='rdfs-seeAlso'>gzopen()</a> - Open gz-file</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_x509_read" value="<div id='function.openssl-x509-read' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-x509-read.php'>openssl_x509_read</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.6, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_x509_read</span> &amp;mdash; <span class='dc-title'>Parse an X.509 certificate and return a resource identifier for it</span></p> </div> <a name='function.openssl-x509-read.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>resource</span> <span class='methodname'><b>openssl_x509_read</b></span> ( <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$x509certdata</tt></span> )</div> <p class='para rdfs-comment'> <b>openssl_x509_read()</b> parses the certificate supplied by <i><tt class='parameter'>x509certdata</tt></i> and returns a resource identifier for it. </p> </div> <a name='function.openssl-x509-read.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>x509certdata</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-x509-read.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns a resource identifier on success, or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_x509_parse" value="<div id='function.openssl-x509-parse' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-x509-parse.php'>openssl_x509_parse</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.6, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_x509_parse</span> &amp;mdash; <span class='dc-title'>Parse an X509 certificate and return the information as an array</span></p> </div> <a name='function.openssl-x509-parse.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>array</span> <span class='methodname'><b>openssl_x509_parse</b></span> ( <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$x509cert</tt></span> [, <span class='methodparam'><span class='type'>bool</span> <tt class='parameter'>$shortnames</tt><span class='initializer'> = true</span></span> ] )</div> <p class='para rdfs-comment'> <b>openssl_x509_parse()</b> returns information about the supplied <i><tt class='parameter'>x509cert</tt></i> , including fields such as subject name, issuer name, purposes, valid from and valid to dates etc. </p> </div> <a name='function.openssl-x509-parse.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>x509cert</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>shortnames</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>shortnames</tt></i> controls how the data is indexed in the array - if <i><tt class='parameter'>shortnames</tt></i> is <b><tt class='constant'>TRUE</tt></b> (the default) then fields will be indexed with the short name form, otherwise, the long name form will be used - e.g.: CN is the shortname form of commonName. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-x509-parse.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> <em class='emphasis'>The structure of the returned data is (deliberately) not yet documented, as it is still subject to change.</em> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_x509_free" value="<div id='function.openssl-x509-free' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-x509-free.php'>openssl_x509_free</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.6, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_x509_free</span> &amp;mdash; <span class='dc-title'>Free certificate resource</span></p> </div> <a name='function.openssl-x509-free.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'><span class='type void'>void</span></span> <span class='methodname'><b>openssl_x509_free</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$x509cert</tt></span> )</div> <p class='para rdfs-comment'> <b>openssl_x509_free()</b> frees the certificate associated with the specified <i><tt class='parameter'>x509cert</tt></i> resource from memory. </p> </div> <a name='function.openssl-x509-free.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>x509cert</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-x509-free.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> No value is returned. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_x509_export_to_file" value="<div id='function.openssl-x509-export-to-file' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-x509-export-to-file.php'>openssl_x509_export_to_file</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.2.0, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_x509_export_to_file</span> &amp;mdash; <span class='dc-title'>Exports a certificate to file</span></p> </div> <a name='function.openssl-x509-export-to-file.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_x509_export_to_file</b></span> ( <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$x509</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$outfilename</tt></span> [, <span class='methodparam'><span class='type'>bool</span> <tt class='parameter'>$notext</tt></span> ] )</div> <p class='para rdfs-comment'> <b>openssl_x509_export_to_file()</b> stores <i><tt class='parameter'>x509</tt></i> into a file named by <i><tt class='parameter'>outfilename</tt></i> in a PEM encoded format. </p> </div> <a name='function.openssl-x509-export-to-file.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>x509</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>outfilename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Path to the output file. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>notext</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The optional parameter <i><tt class='parameter'>notext</tt></i> affects the verbosity of the output; if it is <b><tt class='constant'>FALSE</tt></b>, then additional human-readable information is included in the output. The default value of <i><tt class='parameter'>notext</tt></i> is <b><tt class='constant'>TRUE</tt></b>. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-x509-export-to-file.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_x509_export" value="<div id='function.openssl-x509-export' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-x509-export.php'>openssl_x509_export</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.2.0, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_x509_export</span> &amp;mdash; <span class='dc-title'>Exports a certificate as a string</span></p> </div> <a name='function.openssl-x509-export.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_x509_export</b></span> ( <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$x509</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter reference'>&amp;amp;$output</tt></span> [, <span class='methodparam'><span class='type'>bool</span> <tt class='parameter'>$notext</tt></span> ] )</div> <p class='para rdfs-comment'> <b>openssl_x509_export()</b> stores <i><tt class='parameter'>x509</tt></i> into a string named by <i><tt class='parameter'>output</tt></i> in a PEM encoded format. </p> </div> <a name='function.openssl-x509-export.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>x509</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>output</tt></i> </span> </dt><dd class='listitem'> <p class='para'> On success, this will hold the PEM. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>notext</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The optional parameter <i><tt class='parameter'>notext</tt></i> affects the verbosity of the output; if it is <b><tt class='constant'>FALSE</tt></b>, then additional human-readable information is included in the output. The default value of <i><tt class='parameter'>notext</tt></i> is <b><tt class='constant'>TRUE</tt></b>. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-x509-export.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_x509_checkpurpose" value="<div id='function.openssl-x509-checkpurpose' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-x509-checkpurpose.php'>openssl_x509_checkpurpose</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.6, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_x509_checkpurpose</span> &amp;mdash; <span class='dc-title'>Verifies if a certificate can be used for a particular purpose</span></p> </div> <a name='function.openssl-x509-checkpurpose.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>openssl_x509_checkpurpose</b></span> ( <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$x509cert</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$purpose</tt></span> [, <span class='methodparam'><span class='type'>array</span> <tt class='parameter'>$cainfo</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$untrustedfile</tt></span> ]] )</div> <p class='para rdfs-comment'> <b>openssl_x509_checkpurpose()</b> examines a certificate to see if it can be used for the specified <i><tt class='parameter'>purpose</tt></i> . </p> </div> <a name='function.openssl-x509-checkpurpose.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>x509cert</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The examined certificate. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>purpose</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p><table class='doctable table'> <caption><b><b>openssl_x509_checkpurpose()</b> purposes</b></caption> <thead valign='middle'> <tr valign='middle'> <th>Constant</th> <th>Description</th> </tr> </thead> <tbody valign='middle' class='tbody'> <tr valign='middle'> <td align='left'>X509_PURPOSE_SSL_CLIENT</td> <td align='left'>Can the certificate be used for the client side of an SSL connection?</td> </tr> <tr valign='middle'> <td align='left'>X509_PURPOSE_SSL_SERVER</td> <td align='left'>Can the certificate be used for the server side of an SSL connection?</td> </tr> <tr valign='middle'> <td align='left'>X509_PURPOSE_NS_SSL_SERVER</td> <td align='left'>Can the cert be used for Netscape SSL server?</td> </tr> <tr valign='middle'> <td align='left'>X509_PURPOSE_SMIME_SIGN</td> <td align='left'>Can the cert be used to sign S/MIME email?</td> </tr> <tr valign='middle'> <td align='left'>X509_PURPOSE_SMIME_ENCRYPT</td> <td align='left'>Can the cert be used to encrypt S/MIME email?</td> </tr> <tr valign='middle'> <td align='left'>X509_PURPOSE_CRL_SIGN</td> <td align='left'>Can the cert be used to sign a certificate revocation list (CRL)?</td> </tr> <tr valign='middle'> <td align='left'>X509_PURPOSE_ANY</td> <td align='left'>Can the cert be used for Any/All purposes?</td> </tr> </tbody> </table> <p> These options are not bitfields - you may specify one only! </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>cainfo</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>cainfo</tt></i> should be an array of trusted CA files/dirs as described in <a href='http://www.php.net/manual/en/openssl.cert.verification.php' class='link'>Certificate Verification</a>. It defaults to an empty array. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>untrustedfile</tt></i> </span> </dt><dd class='listitem'> <p class='para'> If specified, this should be the name of a PEM encoded file holding certificates that can be used to help verify the certificate, although no trust is placed in the certificates that come from that file. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-x509-checkpurpose.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> if the certificate can be used for the intended purpose, <b><tt class='constant'>FALSE</tt></b> if it cannot, or -1 on error. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_x509_check_private_key" value="<div id='function.openssl-x509-check-private-key' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-x509-check-private-key.php'>openssl_x509_check_private_key</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.2.0, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_x509_check_private_key</span> &amp;mdash; <span class='dc-title'>Checks if a private key corresponds to a certificate</span></p> </div> <a name='function.openssl-x509-check-private-key.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_x509_check_private_key</b></span> ( <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$cert</tt></span> , <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$key</tt></span> )</div> <p class='para rdfs-comment'> Checks whether the given <i><tt class='parameter'>key</tt></i> is the private key that corresponds to <i><tt class='parameter'>cert</tt></i> . </p> </div> <a name='function.openssl-x509-check-private-key.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>cert</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The certificate. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The private key. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-x509-check-private-key.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> if <i><tt class='parameter'>key</tt></i> is the private key that corresponds to <i><tt class='parameter'>cert</tt></i> , or <b><tt class='constant'>FALSE</tt></b> otherwise. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_verify" value="<div id='function.openssl-verify' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-verify.php'>openssl_verify</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_verify</span> &amp;mdash; <span class='dc-title'>Verify signature</span></p> </div> <a name='function.openssl-verify.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>openssl_verify</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$signature</tt></span> , <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$pub_key_id</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$signature_alg</tt></span> ] )</div> <p class='para rdfs-comment'> <b>openssl_verify()</b> verifies that the <i><tt class='parameter'>signature</tt></i> is correct for the specified <i><tt class='parameter'>data</tt></i> using the public key associated with <i><tt class='parameter'>pub_key_id</tt></i> . This must be the public key corresponding to the private key used for signing. </p> </div> <a name='function.openssl-verify.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>signature</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>pub_key_id</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>signature_alg</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Defaults to <b><tt class='constant'>OPENSSL_ALGO_SHA1</tt></b>. For more information see the list of <a href='http://www.php.net/manual/en/openssl.signature-algos.php' class='link'>Signature Algorithms</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-verify.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns 1 if the signature is correct, 0 if it is incorrect, and -1 on error. </p> </div> <a name='function.openssl-verify.changelog'></a><div class='refsect1 changelog'> <h3 class='title'>Changelog</h3> <p class='para'> </p><table class='doctable informaltable'> <thead valign='middle'> <tr valign='middle'> <th>Version</th> <th>Description</th> </tr> </thead> <tbody valign='middle' class='tbody'> <tr valign='middle'> <td align='left'>5.0.0</td> <td align='left'> The <i><tt class='parameter'>signature_alg</tt></i> parameter was added. </td> </tr> </tbody> </table> <p> </p> </div> <a name='function.openssl-verify.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>openssl_verify()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /></span><span style='color: #FF8000'>//&amp;nbsp;$data&amp;nbsp;and&amp;nbsp;$signature&amp;nbsp;are&amp;nbsp;assumed&amp;nbsp;to&amp;nbsp;contain&amp;nbsp;the&amp;nbsp;data&amp;nbsp;and&amp;nbsp;the&amp;nbsp;signature<br /><br />//&amp;nbsp;fetch&amp;nbsp;public&amp;nbsp;key&amp;nbsp;from&amp;nbsp;certificate&amp;nbsp;and&amp;nbsp;ready&amp;nbsp;it<br /></span><span style='color: #0000BB'>$fp&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>fopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'/src/openssl-0.9.6/demos/sign/cert.pem'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'r'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>$cert&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>fread</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>8192</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>fclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>$pubkeyid&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>openssl_get_publickey</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$cert</span><span style='color: #007700'>);<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;state&amp;nbsp;whether&amp;nbsp;signature&amp;nbsp;is&amp;nbsp;okay&amp;nbsp;or&amp;nbsp;not<br /></span><span style='color: #0000BB'>$ok&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>openssl_verify</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$data</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$signature</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$pubkeyid</span><span style='color: #007700'>);<br />if&amp;nbsp;(</span><span style='color: #0000BB'>$ok&amp;nbsp;</span><span style='color: #007700'>==&amp;nbsp;</span><span style='color: #0000BB'>1</span><span style='color: #007700'>)&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #DD0000'>'good'</span><span style='color: #007700'>;<br />}&amp;nbsp;elseif&amp;nbsp;(</span><span style='color: #0000BB'>$ok&amp;nbsp;</span><span style='color: #007700'>==&amp;nbsp;</span><span style='color: #0000BB'>0</span><span style='color: #007700'>)&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #DD0000'>'bad'</span><span style='color: #007700'>;<br />}&amp;nbsp;else&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #DD0000'>'ugly,&amp;nbsp;error&amp;nbsp;checking&amp;nbsp;signature'</span><span style='color: #007700'>;<br />}<br /></span><span style='color: #FF8000'>//&amp;nbsp;free&amp;nbsp;the&amp;nbsp;key&amp;nbsp;from&amp;nbsp;memory<br /></span><span style='color: #0000BB'>openssl_free_key</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$pubkeyid</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.openssl-verify.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-sign.php' class='function' rel='rdfs-seeAlso'>openssl_sign()</a> - Generate signature</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_sign" value="<div id='function.openssl-sign' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-sign.php'>openssl_sign</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_sign</span> &amp;mdash; <span class='dc-title'>Generate signature</span></p> </div> <a name='function.openssl-sign.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_sign</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter reference'>&amp;amp;$signature</tt></span> , <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$priv_key_id</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$signature_alg</tt><span class='initializer'> = OPENSSL_ALGO_SHA1</span></span> ] )</div> <p class='para rdfs-comment'> <b>openssl_sign()</b> computes a signature for the specified <i><tt class='parameter'>data</tt></i> by using SHA1 for hashing followed by encryption using the private key associated with <i><tt class='parameter'>priv_key_id</tt></i> . Note that the data itself is not encrypted. </p> </div> <a name='function.openssl-sign.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>signature</tt></i> </span> </dt><dd class='listitem'> <p class='para'> If the call was successful the signature is returned in <i><tt class='parameter'>signature</tt></i> . </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>priv_key_id</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>signature_alg</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Defaults to <b><tt class='constant'>OPENSSL_ALGO_SHA1</tt></b>. For more information see the list of <a href='http://www.php.net/manual/en/openssl.signature-algos.php' class='link'>Signature Algorithms</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-sign.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.openssl-sign.changelog'></a><div class='refsect1 changelog'> <h3 class='title'>Changelog</h3> <p class='para'> </p><table class='doctable informaltable'> <thead valign='middle'> <tr valign='middle'> <th>Version</th> <th>Description</th> </tr> </thead> <tbody valign='middle' class='tbody'> <tr valign='middle'> <td align='left'>5.0.0</td> <td align='left'> The <i><tt class='parameter'>signature_alg</tt></i> parameter was added. </td> </tr> </tbody> </table> <p> </p> </div> <a name='function.openssl-sign.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>openssl_sign()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /></span><span style='color: #FF8000'>//&amp;nbsp;$data&amp;nbsp;is&amp;nbsp;assumed&amp;nbsp;to&amp;nbsp;contain&amp;nbsp;the&amp;nbsp;data&amp;nbsp;to&amp;nbsp;be&amp;nbsp;signed<br /><br />//&amp;nbsp;fetch&amp;nbsp;private&amp;nbsp;key&amp;nbsp;from&amp;nbsp;file&amp;nbsp;and&amp;nbsp;ready&amp;nbsp;it<br /></span><span style='color: #0000BB'>$fp&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>fopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'/src/openssl-0.9.6/demos/sign/key.pem'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'r'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>$priv_key&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>fread</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>8192</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>fclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>$pkeyid&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>openssl_get_privatekey</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$priv_key</span><span style='color: #007700'>);<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;compute&amp;nbsp;signature<br /></span><span style='color: #0000BB'>openssl_sign</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$data</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$signature</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$pkeyid</span><span style='color: #007700'>);<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;free&amp;nbsp;the&amp;nbsp;key&amp;nbsp;from&amp;nbsp;memory<br /></span><span style='color: #0000BB'>openssl_free_key</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$pkeyid</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.openssl-sign.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-verify.php' class='function' rel='rdfs-seeAlso'>openssl_verify()</a> - Verify signature</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_seal" value="<div id='function.openssl-seal' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-seal.php'>openssl_seal</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_seal</span> &amp;mdash; <span class='dc-title'>Seal (encrypt) data</span></p> </div> <a name='function.openssl-seal.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>openssl_seal</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter reference'>&amp;amp;$sealed_data</tt></span> , <span class='methodparam'><span class='type'>array</span> <tt class='parameter reference'>&amp;amp;$env_keys</tt></span> , <span class='methodparam'><span class='type'>array</span> <tt class='parameter'>$pub_key_ids</tt></span> )</div> <p class='para rdfs-comment'> <b>openssl_seal()</b> seals (encrypts) <i><tt class='parameter'>data</tt></i> by using RC4 with a randomly generated secret key. The key is encrypted with each of the public keys associated with the identifiers in <i><tt class='parameter'>pub_key_ids</tt></i> and each encrypted key is returned in <i><tt class='parameter'>env_keys</tt></i> . This means that one can send sealed data to multiple recipients (provided one has obtained their public keys). Each recipient must receive both the sealed data and the envelope key that was encrypted with the recipient&amp;#039;s public key. </p> </div> <a name='function.openssl-seal.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>sealed_data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>env_keys</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>pub_key_ids</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-seal.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the length of the sealed data on success, or <b><tt class='constant'>FALSE</tt></b> on error. If successful the sealed data is returned in <i><tt class='parameter'>sealed_data</tt></i> , and the envelope keys in <i><tt class='parameter'>env_keys</tt></i> . </p> </div> <a name='function.openssl-seal.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>openssl_seal()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /></span><span style='color: #FF8000'>//&amp;nbsp;$data&amp;nbsp;is&amp;nbsp;assumed&amp;nbsp;to&amp;nbsp;contain&amp;nbsp;the&amp;nbsp;data&amp;nbsp;to&amp;nbsp;be&amp;nbsp;sealed<br /><br />//&amp;nbsp;fetch&amp;nbsp;public&amp;nbsp;keys&amp;nbsp;for&amp;nbsp;our&amp;nbsp;recipients,&amp;nbsp;and&amp;nbsp;ready&amp;nbsp;them<br /></span><span style='color: #0000BB'>$fp&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>fopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'/src/openssl-0.9.6/demos/maurice/cert.pem'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'r'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>$cert&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>fread</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>8192</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>fclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>$pk1&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>openssl_get_publickey</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$cert</span><span style='color: #007700'>);<br /></span><span style='color: #FF8000'>//&amp;nbsp;Repeat&amp;nbsp;for&amp;nbsp;second&amp;nbsp;recipient<br /></span><span style='color: #0000BB'>$fp&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>fopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'/src/openssl-0.9.6/demos/sign/cert.pem'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'r'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>$cert&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>fread</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>8192</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>fclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>$pk2&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>openssl_get_publickey</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$cert</span><span style='color: #007700'>);<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;seal&amp;nbsp;message,&amp;nbsp;only&amp;nbsp;owners&amp;nbsp;of&amp;nbsp;$pk1&amp;nbsp;and&amp;nbsp;$pk2&amp;nbsp;can&amp;nbsp;decrypt&amp;nbsp;$sealed&amp;nbsp;with&amp;nbsp;keys<br />//&amp;nbsp;$ekeys[0]&amp;nbsp;and&amp;nbsp;$ekeys[1]&amp;nbsp;respectively.<br /></span><span style='color: #0000BB'>openssl_seal</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$data</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$sealed</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$ekeys</span><span style='color: #007700'>,&amp;nbsp;array(</span><span style='color: #0000BB'>$pk1</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$pk2</span><span style='color: #007700'>));<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;free&amp;nbsp;the&amp;nbsp;keys&amp;nbsp;from&amp;nbsp;memory<br /></span><span style='color: #0000BB'>openssl_free_key</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$pk1</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>openssl_free_key</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$pk2</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.openssl-seal.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-open.php' class='function' rel='rdfs-seeAlso'>openssl_open()</a> - Open sealed data</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_public_encrypt" value="<div id='function.openssl-public-encrypt' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-public-encrypt.php'>openssl_public_encrypt</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.6, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_public_encrypt</span> &amp;mdash; <span class='dc-title'>Encrypts data with public key </span></p> </div> <a name='function.openssl-public-encrypt.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_public_encrypt</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter reference'>&amp;amp;$crypted</tt></span> , <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$key</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$padding</tt><span class='initializer'> = OPENSSL_PKCS1_PADDING</span></span> ] )</div> <p class='para rdfs-comment'> <b>openssl_public_encrypt()</b> encrypts <i><tt class='parameter'>data</tt></i> with public <i><tt class='parameter'>key</tt></i> and stores the result into <i><tt class='parameter'>crypted</tt></i> . Encrypted data can be decrypted via <a href='http://www.php.net/manual/en/function.openssl-private-decrypt.php' class='function'>openssl_private_decrypt()</a>. </p> <p class='para'> This function can be used e.g. to encrypt message which can be then read only by owner of the private key. It can be also used to store secure data in database. </p> </div> <a name='function.openssl-public-encrypt.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>crypted</tt></i> </span> </dt><dd class='listitem'> <p class='para'> This will hold the result of the encryption. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The public key. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>padding</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>padding</tt></i> defaults to <b><tt class='constant'>OPENSSL_PKCS1_PADDING</tt></b>, but can also be one of <b><tt class='constant'>OPENSSL_SSLV23_PADDING</tt></b>, <b><tt class='constant'>OPENSSL_PKCS1_OAEP_PADDING</tt></b>, <b><tt class='constant'>OPENSSL_NO_PADDING</tt></b>. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-public-encrypt.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.openssl-public-encrypt.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-private-encrypt.php' class='function' rel='rdfs-seeAlso'>openssl_private_encrypt()</a> - Encrypts data with private key</li> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-private-decrypt.php' class='function' rel='rdfs-seeAlso'>openssl_private_decrypt()</a> - Decrypts data with private key</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_public_decrypt" value="<div id='function.openssl-public-decrypt' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-public-decrypt.php'>openssl_public_decrypt</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.6, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_public_decrypt</span> &amp;mdash; <span class='dc-title'>Decrypts data with public key </span></p> </div> <a name='function.openssl-public-decrypt.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_public_decrypt</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter reference'>&amp;amp;$decrypted</tt></span> , <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$key</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$padding</tt><span class='initializer'> = OPENSSL_PKCS1_PADDING</span></span> ] )</div> <p class='para rdfs-comment'> <b>openssl_public_decrypt()</b> decrypts <i><tt class='parameter'>data</tt></i> that was previous encrypted via <a href='http://www.php.net/manual/en/function.openssl-private-encrypt.php' class='function'>openssl_private_encrypt()</a> and stores the result into <i><tt class='parameter'>decrypted</tt></i> . </p> <p class='para'> You can use this function e.g. to check if the message was written by the owner of the private key. </p> </div> <a name='function.openssl-public-decrypt.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>decrypted</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>key</tt></i> must be the public key corresponding that was used to encrypt the data. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>padding</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>padding</tt></i> defaults to <b><tt class='constant'>OPENSSL_PKCS1_PADDING</tt></b>, but can also be <b><tt class='constant'>OPENSSL_NO_PADDING</tt></b>. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-public-decrypt.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.openssl-public-decrypt.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-private-encrypt.php' class='function' rel='rdfs-seeAlso'>openssl_private_encrypt()</a> - Encrypts data with private key</li> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-private-decrypt.php' class='function' rel='rdfs-seeAlso'>openssl_private_decrypt()</a> - Decrypts data with private key</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_private_encrypt" value="<div id='function.openssl-private-encrypt' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-private-encrypt.php'>openssl_private_encrypt</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.6, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_private_encrypt</span> &amp;mdash; <span class='dc-title'>Encrypts data with private key </span></p> </div> <a name='function.openssl-private-encrypt.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_private_encrypt</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter reference'>&amp;amp;$crypted</tt></span> , <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$key</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$padding</tt><span class='initializer'> = OPENSSL_PKCS1_PADDING</span></span> ] )</div> <p class='para rdfs-comment'> <b>openssl_private_encrypt()</b> encrypts <i><tt class='parameter'>data</tt></i> with private <i><tt class='parameter'>key</tt></i> and stores the result into <i><tt class='parameter'>crypted</tt></i> . Encrypted data can be decrypted via <a href='http://www.php.net/manual/en/function.openssl-public-decrypt.php' class='function'>openssl_public_decrypt()</a>. </p> <p class='para'> This function can be used e.g. to sign data (or its hash) to prove that it is not written by someone else. </p> </div> <a name='function.openssl-private-encrypt.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>crypted</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>padding</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>padding</tt></i> defaults to <b><tt class='constant'>OPENSSL_PKCS1_PADDING</tt></b>, but can also be <b><tt class='constant'>OPENSSL_NO_PADDING</tt></b>. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-private-encrypt.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.openssl-private-encrypt.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-public-encrypt.php' class='function' rel='rdfs-seeAlso'>openssl_public_encrypt()</a> - Encrypts data with public key</li> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-public-decrypt.php' class='function' rel='rdfs-seeAlso'>openssl_public_decrypt()</a> - Decrypts data with public key</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_private_decrypt" value="<div id='function.openssl-private-decrypt' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-private-decrypt.php'>openssl_private_decrypt</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.6, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_private_decrypt</span> &amp;mdash; <span class='dc-title'>Decrypts data with private key </span></p> </div> <a name='function.openssl-private-decrypt.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_private_decrypt</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter reference'>&amp;amp;$decrypted</tt></span> , <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$key</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$padding</tt><span class='initializer'> = OPENSSL_PKCS1_PADDING</span></span> ] )</div> <p class='para rdfs-comment'> <b>openssl_private_decrypt()</b> decrypts <i><tt class='parameter'>data</tt></i> that was previous encrypted via <a href='http://www.php.net/manual/en/function.openssl-public-encrypt.php' class='function'>openssl_public_encrypt()</a> and stores the result into <i><tt class='parameter'>decrypted</tt></i> . </p> <p class='para'> You can use this function e.g. to decrypt data which were supposed only to you. </p> </div> <a name='function.openssl-private-decrypt.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>decrypted</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>key</tt></i> must be the private key corresponding that was used to encrypt the data. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>padding</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>padding</tt></i> defaults to <b><tt class='constant'>OPENSSL_PKCS1_PADDING</tt></b>, but can also be one of <b><tt class='constant'>OPENSSL_SSLV23_PADDING</tt></b>, <b><tt class='constant'>OPENSSL_PKCS1_OAEP_PADDING</tt></b>, <b><tt class='constant'>OPENSSL_NO_PADDING</tt></b>. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-private-decrypt.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.openssl-private-decrypt.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-public-encrypt.php' class='function' rel='rdfs-seeAlso'>openssl_public_encrypt()</a> - Encrypts data with public key</li> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-public-decrypt.php' class='function' rel='rdfs-seeAlso'>openssl_public_decrypt()</a> - Decrypts data with public key</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_pkey_new" value="<div id='function.openssl-pkey-new' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-pkey-new.php'>openssl_pkey_new</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.2.0, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_pkey_new</span> &amp;mdash; <span class='dc-title'>Generates a new private key </span></p> </div> <a name='function.openssl-pkey-new.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>resource</span> <span class='methodname'><b>openssl_pkey_new</b></span> ([ <span class='methodparam'><span class='type'>array</span> <tt class='parameter'>$configargs</tt></span> ] )</div> <p class='para rdfs-comment'> <b>openssl_pkey_new()</b> generates a new private and public key pair. The public component of the key can be obtained using <a href='http://www.php.net/manual/en/function.openssl-pkey-get-public.php' class='function'>openssl_pkey_get_public()</a>. </p> <blockquote><p><b class='note'>Note</b>: <span class='simpara'> You need to have a valid <var class='filename'>openssl.cnf</var> installed for this function to operate correctly. See the notes under <a href='http://www.php.net/manual/en/openssl.installation.php' class='link'>the installation section</a> for more information. </span> </p></blockquote> </div> <a name='function.openssl-pkey-new.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>configargs</tt></i> </span> </dt><dd class='listitem'> <p class='para'> You can finetune the key generation (such as specifying the number of bits) using <i><tt class='parameter'>configargs</tt></i> . See <a href='http://www.php.net/manual/en/function.openssl-csr-new.php' class='function'>openssl_csr_new()</a> for more information about <i><tt class='parameter'>configargs</tt></i> . </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-pkey-new.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns a resource identifier for the pkey on success, or <b><tt class='constant'>FALSE</tt></b> on error. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_pkey_get_public" value="<div id='function.openssl-pkey-get-public' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-pkey-get-public.php'>openssl_pkey_get_public</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.2.0, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_pkey_get_public</span> &amp;mdash; <span class='dc-title'>Extract public key from certificate and prepare it for use</span></p> </div> <a name='function.openssl-pkey-get-public.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>resource</span> <span class='methodname'><b>openssl_pkey_get_public</b></span> ( <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$certificate</tt></span> )</div> <p class='para rdfs-comment'> <a href='http://www.php.net/manual/en/function.openssl-get-publickey.php' class='function'>openssl_get_publickey()</a> extracts the public key from <i><tt class='parameter'>certificate</tt></i> and prepares it for use by other functions. </p> </div> <a name='function.openssl-pkey-get-public.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>certificate</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>certificate</tt></i> can be one of the following: </p><ol type='1'> <li class='listitem'><span class='simpara'>an X.509 certificate resource</span></li> <li class='listitem'><span class='simpara'>a string having the format <var class='filename'>file://path/to/file.pem</var>. The named file must contain a PEM encoded certificate/private key (it may contain both). </span> </li> <li class='listitem'><span class='simpara'>A PEM formatted private key.</span></li> </ol><p> </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-pkey-get-public.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns a positive key resource identifier on success, or <b><tt class='constant'>FALSE</tt></b> on error. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_pkey_get_private" value="<div id='function.openssl-pkey-get-private' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-pkey-get-private.php'>openssl_pkey_get_private</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.2.0, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_pkey_get_private</span> &amp;mdash; <span class='dc-title'>Get a private key</span></p> </div> <a name='function.openssl-pkey-get-private.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>resource</span> <span class='methodname'><b>openssl_pkey_get_private</b></span> ( <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$key</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$passphrase</tt><span class='initializer'> = &amp;quot;&amp;quot;</span></span> ] )</div> <p class='para rdfs-comment'> <a href='http://www.php.net/manual/en/function.openssl-get-privatekey.php' class='function'>openssl_get_privatekey()</a> parses <i><tt class='parameter'>key</tt></i> and prepares it for use by other functions. </p> </div> <a name='function.openssl-pkey-get-private.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>key</tt></i> can be one of the following: </p><ol type='1'> <li class='listitem'><span class='simpara'>a string having the format <var class='filename'>file://path/to/file.pem</var>. The named file must contain a PEM encoded certificate/private key (it may contain both). </span> </li> <li class='listitem'><span class='simpara'>A PEM formatted private key.</span></li> </ol><p> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>passphrase</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The optional parameter <i><tt class='parameter'>passphrase</tt></i> must be used if the specified key is encrypted (protected by a passphrase). </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-pkey-get-private.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns a positive key resource identifier on success, or <b><tt class='constant'>FALSE</tt></b> on error. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_pkey_get_details" value="<div id='function.openssl-pkey-get-details' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-pkey-get-details.php'>openssl_pkey_get_details</a></h1> <p class='verinfo'>(PHP 5 &amp;gt;= 5.2.0)</p><p class='refpurpose'><span class='refname'>openssl_pkey_get_details</span> &amp;mdash; <span class='dc-title'>Returns an array with the key details</span></p> </div> <a name='function.openssl-pkey-get-details.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>array</span> <span class='methodname'><b>openssl_pkey_get_details</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$key</tt></span> )</div> <p class='para rdfs-comment'> This function returns the key details (bits, key, type). </p> </div> <a name='function.openssl-pkey-get-details.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Resource holding the key. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-pkey-get-details.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns an array with the key details in success or <b><tt class='constant'>FALSE</tt></b> in failure. Returned array has indexes <i>bits</i> (number of bits), <i>key</i> (string representation of the public key) and <i>type</i> (type of the key which is one of <b><tt class='constant'>OPENSSL_KEYTYPE_RSA</tt></b>, <b><tt class='constant'>OPENSSL_KEYTYPE_DSA</tt></b>, <b><tt class='constant'>OPENSSL_KEYTYPE_DH</tt></b>, <b><tt class='constant'>OPENSSL_KEYTYPE_EC</tt></b> or -1 meaning unknown). </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_pkey_free" value="<div id='function.openssl-pkey-free' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-pkey-free.php'>openssl_pkey_free</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.2.0, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_pkey_free</span> &amp;mdash; <span class='dc-title'>Frees a private key</span></p> </div> <a name='function.openssl-pkey-free.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'><span class='type void'>void</span></span> <span class='methodname'><b>openssl_pkey_free</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$key</tt></span> )</div> <p class='para rdfs-comment'> This function frees a private key created by <a href='http://www.php.net/manual/en/function.openssl-pkey-new.php' class='function'>openssl_pkey_new()</a>. </p> </div> <a name='function.openssl-pkey-free.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Resource holding the key. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-pkey-free.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> No value is returned. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_pkey_export_to_file" value="<div id='function.openssl-pkey-export-to-file' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-pkey-export-to-file.php'>openssl_pkey_export_to_file</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.2.0, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_pkey_export_to_file</span> &amp;mdash; <span class='dc-title'>Gets an exportable representation of a key into a file </span></p> </div> <a name='function.openssl-pkey-export-to-file.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_pkey_export_to_file</b></span> ( <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$key</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$outfilename</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$passphrase</tt></span> [, <span class='methodparam'><span class='type'>array</span> <tt class='parameter'>$configargs</tt></span> ]] )</div> <p class='para rdfs-comment'> <b>openssl_pkey_export_to_file()</b> saves an ascii-armoured (PEM encoded) rendition of <i><tt class='parameter'>key</tt></i> into the file named by <i><tt class='parameter'>outfilename</tt></i> . </p> <blockquote><p><b class='note'>Note</b>: <span class='simpara'> You need to have a valid <var class='filename'>openssl.cnf</var> installed for this function to operate correctly. See the notes under <a href='http://www.php.net/manual/en/openssl.installation.php' class='link'>the installation section</a> for more information. </span> </p></blockquote> </div> <a name='function.openssl-pkey-export-to-file.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>outfilename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Path to the output file. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>passphrase</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The key can be optionally protected by a <i><tt class='parameter'>passphrase</tt></i> . </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>configargs</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>configargs</tt></i> can be used to fine-tune the export process by specifying and/or overriding options for the openssl configuration file. See <a href='http://www.php.net/manual/en/function.openssl-csr-new.php' class='function'>openssl_csr_new()</a> for more information about <i><tt class='parameter'>configargs</tt></i> . </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-pkey-export-to-file.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_pkey_export" value="<div id='function.openssl-pkey-export' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-pkey-export.php'>openssl_pkey_export</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.2.0, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_pkey_export</span> &amp;mdash; <span class='dc-title'>Gets an exportable representation of a key into a string</span></p> </div> <a name='function.openssl-pkey-export.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_pkey_export</b></span> ( <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$key</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter reference'>&amp;amp;$out</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$passphrase</tt></span> [, <span class='methodparam'><span class='type'>array</span> <tt class='parameter'>$configargs</tt></span> ]] )</div> <p class='para rdfs-comment'> <b>openssl_pkey_export()</b> exports <i><tt class='parameter'>key</tt></i> as a PEM encoded string and stores it into <i><tt class='parameter'>out</tt></i> (which is passed by reference). </p> <blockquote><p><b class='note'>Note</b>: <span class='simpara'> You need to have a valid <var class='filename'>openssl.cnf</var> installed for this function to operate correctly. See the notes under <a href='http://www.php.net/manual/en/openssl.installation.php' class='link'>the installation section</a> for more information. </span> </p></blockquote> </div> <a name='function.openssl-pkey-export.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>out</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>passphrase</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The key is optionally protected by <i><tt class='parameter'>passphrase</tt></i> . </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>configargs</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>configargs</tt></i> can be used to fine-tune the export process by specifying and/or overriding options for the openssl configuration file. See <a href='http://www.php.net/manual/en/function.openssl-csr-new.php' class='function'>openssl_csr_new()</a> for more information about <i><tt class='parameter'>configargs</tt></i> . </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-pkey-export.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_pkcs7_verify" value="<div id='function.openssl-pkcs7-verify' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-pkcs7-verify.php'>openssl_pkcs7_verify</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.6, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_pkcs7_verify</span> &amp;mdash; <span class='dc-title'>Verifies the signature of an S/MIME signed message</span></p> </div> <a name='function.openssl-pkcs7-verify.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <span class='methodname'><b>openssl_pkcs7_verify</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$filename</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$flags</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$outfilename</tt></span> [, <span class='methodparam'><span class='type'>array</span> <tt class='parameter'>$cainfo</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$extracerts</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$content</tt></span> ]]]] )</div> <p class='para rdfs-comment'> <b>openssl_pkcs7_verify()</b> reads the S/MIME message contained in the given file and examines the digital signature. </p> </div> <a name='function.openssl-pkcs7-verify.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>filename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Path to the message. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>flags</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>flags</tt></i> can be used to affect how the signature is verified - see <a href='http://www.php.net/manual/en/openssl.pkcs7.flags.php' class='link'>PKCS7 constants</a> for more information. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>outfilename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> If the <i><tt class='parameter'>outfilename</tt></i> is specified, it should be a string holding the name of a file into which the certificates of the persons that signed the messages will be stored in PEM format. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>cainfo</tt></i> </span> </dt><dd class='listitem'> <p class='para'> If the <i><tt class='parameter'>cainfo</tt></i> is specified, it should hold information about the trusted CA certificates to use in the verification process - see <a href='http://www.php.net/manual/en/openssl.cert.verification.php' class='link'>certificate verification</a> for more information about this parameter. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>extracerts</tt></i> </span> </dt><dd class='listitem'> <p class='para'> If the <i><tt class='parameter'>extracerts</tt></i> is specified, it is the filename of a file containing a bunch of certificates to use as untrusted CAs. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>content</tt></i> </span> </dt><dd class='listitem'> <p class='para'> You can specify a filename with <i><tt class='parameter'>content</tt></i> that will be filled with the verified data, but with the signature information stripped. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-pkcs7-verify.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> if the signature is verified, <b><tt class='constant'>FALSE</tt></b> if it is not correct (the message has been tampered with, or the signing certificate is invalid), or -1 on error. </p> </div> <a name='function.openssl-pkcs7-verify.changelog'></a><div class='refsect1 changelog'> <h3 class='title'>Changelog</h3> <p class='para'> </p><table class='doctable informaltable'> <thead valign='middle'> <tr valign='middle'> <th>Version</th> <th>Description</th> </tr> </thead> <tbody valign='middle' class='tbody'> <tr valign='middle'> <td align='left'>5.1.0</td> <td align='left'> The <i><tt class='parameter'>content</tt></i> parameter was added. </td> </tr> </tbody> </table> <p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_pkcs7_sign" value="<div id='function.openssl-pkcs7-sign' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-pkcs7-sign.php'>openssl_pkcs7_sign</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.6, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_pkcs7_sign</span> &amp;mdash; <span class='dc-title'>Sign an S/MIME message</span></p> </div> <a name='function.openssl-pkcs7-sign.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_pkcs7_sign</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$infilename</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$outfilename</tt></span> , <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$signcert</tt></span> , <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$privkey</tt></span> , <span class='methodparam'><span class='type'>array</span> <tt class='parameter'>$headers</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$flags</tt><span class='initializer'> = PKCS7_DETACHED</span></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$extracerts</tt></span> ]] )</div> <p class='para rdfs-comment'> <b>openssl_pkcs7_sign()</b> takes the contents of the file named <i><tt class='parameter'>infilename</tt></i> and signs them using the certificate and its matching private key specified by <i><tt class='parameter'>signcert</tt></i> and <i><tt class='parameter'>privkey</tt></i> parameters. </p> </div> <a name='function.openssl-pkcs7-sign.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>infilename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>outfilename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>signcert</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>privkey</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>headers</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>headers</tt></i> is an array of headers that will be prepended to the data after it has been signed (see <a href='http://www.php.net/manual/en/function.openssl-pkcs7-encrypt.php' class='function'>openssl_pkcs7_encrypt()</a> for more information about the format of this parameter. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>flags</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>flags</tt></i> can be used to alter the output - see <a href='http://www.php.net/manual/en/openssl.pkcs7.flags.php' class='link'>PKCS7 constants</a> - if not specified, it defaults to PKCS7_DETACHED. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>extracerts</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>extracerts</tt></i> specifies the name of a file containing a bunch of extra certificates to include in the signature which can for example be used to help the recipient to verify the certificate that you used. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-pkcs7-sign.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.openssl-pkcs7-sign.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>openssl_pkcs7_sign()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /></span><span style='color: #FF8000'>//&amp;nbsp;the&amp;nbsp;message&amp;nbsp;you&amp;nbsp;want&amp;nbsp;to&amp;nbsp;sign&amp;nbsp;so&amp;nbsp;that&amp;nbsp;recipient&amp;nbsp;can&amp;nbsp;be&amp;nbsp;sure&amp;nbsp;it&amp;nbsp;was&amp;nbsp;you&amp;nbsp;that<br />//&amp;nbsp;sent&amp;nbsp;it<br /></span><span style='color: #0000BB'>$data&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;&amp;lt;&amp;lt;&amp;lt;EOD<br /></span><span style='color: #DD0000'><br />You&amp;nbsp;have&amp;nbsp;my&amp;nbsp;authorization&amp;nbsp;to&amp;nbsp;spend&amp;nbsp;$10,000&amp;nbsp;on&amp;nbsp;dinner&amp;nbsp;expenses.<br /><br />The&amp;nbsp;CEO<br /></span><span style='color: #007700'>EOD;<br /></span><span style='color: #FF8000'>//&amp;nbsp;save&amp;nbsp;message&amp;nbsp;to&amp;nbsp;file<br /></span><span style='color: #0000BB'>$fp&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>fopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'msg.txt'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'w'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>fwrite</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$data</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>fclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>);<br /></span><span style='color: #FF8000'>//&amp;nbsp;encrypt&amp;nbsp;it<br /></span><span style='color: #007700'>if&amp;nbsp;(</span><span style='color: #0000BB'>openssl_pkcs7_sign</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'msg.txt'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'signed.txt'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'mycert.pem'</span><span style='color: #007700'>,<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;array(</span><span style='color: #DD0000'>'file://mycert.pem'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'mypassphrase'</span><span style='color: #007700'>),<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;array(</span><span style='color: #DD0000'>'To'&amp;nbsp;</span><span style='color: #007700'>=&amp;gt;&amp;nbsp;</span><span style='color: #DD0000'>'joes@example.com'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #FF8000'>//&amp;nbsp;keyed&amp;nbsp;syntax<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #DD0000'>'From:&amp;nbsp;HQ&amp;nbsp;&amp;lt;ceo@example.com&amp;gt;'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #FF8000'>//&amp;nbsp;indexed&amp;nbsp;syntax<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #DD0000'>'Subject'&amp;nbsp;</span><span style='color: #007700'>=&amp;gt;&amp;nbsp;</span><span style='color: #DD0000'>'Eyes&amp;nbsp;only'</span><span style='color: #007700'>)<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;))&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>//&amp;nbsp;message&amp;nbsp;signed&amp;nbsp;-&amp;nbsp;send&amp;nbsp;it!<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>exec</span><span style='color: #007700'>(</span><span style='color: #0000BB'>ini_get</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'sendmail_path'</span><span style='color: #007700'>)&amp;nbsp;.&amp;nbsp;</span><span style='color: #DD0000'>'&amp;nbsp;&amp;lt;&amp;nbsp;signed.txt'</span><span style='color: #007700'>);<br />}<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_pkcs7_encrypt" value="<div id='function.openssl-pkcs7-encrypt' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-pkcs7-encrypt.php'>openssl_pkcs7_encrypt</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.6, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_pkcs7_encrypt</span> &amp;mdash; <span class='dc-title'>Encrypt an S/MIME message</span></p> </div> <a name='function.openssl-pkcs7-encrypt.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_pkcs7_encrypt</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$infile</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$outfile</tt></span> , <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$recipcerts</tt></span> , <span class='methodparam'><span class='type'>array</span> <tt class='parameter'>$headers</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$flags</tt><span class='initializer'> = 0</span></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$cipherid</tt><span class='initializer'> = OPENSSL_CIPHER_RC2_40</span></span> ]] )</div> <p class='para rdfs-comment'> <b>openssl_pkcs7_encrypt()</b> takes the contents of the file named <i><tt class='parameter'>infile</tt></i> and encrypts them using an RC2 40-bit cipher so that they can only be read by the intended recipients specified by <i><tt class='parameter'>recipcerts</tt></i> . </p> </div> <a name='function.openssl-pkcs7-encrypt.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>infile</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>outfile</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>recipcerts</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Either a lone X.509 certificate, or an array of X.509 certificates. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>headers</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>headers</tt></i> is an array of headers that will be prepended to the data after it has been encrypted. </p> <p class='para'> <i><tt class='parameter'>headers</tt></i> can be either an associative array keyed by header name, or an indexed array, where each element contains a single header line. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>flags</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>flags</tt></i> can be used to specify options that affect the encoding process - see <a href='http://www.php.net/manual/en/openssl.pkcs7.flags.php' class='link'>PKCS7 constants</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>cipherid</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Cipher can be selected with <i><tt class='parameter'>cipherid</tt></i> . </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-pkcs7-encrypt.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.openssl-pkcs7-encrypt.changelog'></a><div class='refsect1 changelog'> <h3 class='title'>Changelog</h3> <p class='para'> </p><table class='doctable informaltable'> <thead valign='middle'> <tr valign='middle'> <th>Version</th> <th>Description</th> </tr> </thead> <tbody valign='middle' class='tbody'> <tr valign='middle'> <td align='left'>5.0.0</td> <td align='left'> The <i><tt class='parameter'>cipherid</tt></i> parameter was added. </td> </tr> </tbody> </table> <p> </p> </div> <a name='function.openssl-pkcs7-encrypt.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>openssl_pkcs7_encrypt()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /></span><span style='color: #FF8000'>//&amp;nbsp;the&amp;nbsp;message&amp;nbsp;you&amp;nbsp;want&amp;nbsp;to&amp;nbsp;encrypt&amp;nbsp;and&amp;nbsp;send&amp;nbsp;to&amp;nbsp;your&amp;nbsp;secret&amp;nbsp;agent<br />//&amp;nbsp;in&amp;nbsp;the&amp;nbsp;field,&amp;nbsp;known&amp;nbsp;as&amp;nbsp;nighthawk.&amp;nbsp;&amp;nbsp;You&amp;nbsp;have&amp;nbsp;his&amp;nbsp;certificate<br />//&amp;nbsp;in&amp;nbsp;the&amp;nbsp;file&amp;nbsp;nighthawk.pem<br /></span><span style='color: #0000BB'>$data&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;&amp;lt;&amp;lt;&amp;lt;EOD<br /></span><span style='color: #DD0000'>Nighthawk,<br /><br />Top&amp;nbsp;secret,&amp;nbsp;for&amp;nbsp;your&amp;nbsp;eyes&amp;nbsp;only!<br /><br />The&amp;nbsp;enemy&amp;nbsp;is&amp;nbsp;closing&amp;nbsp;in!&amp;nbsp;Meet&amp;nbsp;me&amp;nbsp;at&amp;nbsp;the&amp;nbsp;cafe&amp;nbsp;at&amp;nbsp;8.30am<br />to&amp;nbsp;collect&amp;nbsp;your&amp;nbsp;forged&amp;nbsp;passport!<br /><br />HQ<br /></span><span style='color: #007700'>EOD;<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;load&amp;nbsp;key<br /></span><span style='color: #0000BB'>$key&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>file_get_contents</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'nighthawk.pem'</span><span style='color: #007700'>);<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;save&amp;nbsp;message&amp;nbsp;to&amp;nbsp;file<br /></span><span style='color: #0000BB'>$fp&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>fopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'msg.txt'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'w'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>fwrite</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$data</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>fclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>);<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;encrypt&amp;nbsp;it<br /></span><span style='color: #007700'>if&amp;nbsp;(</span><span style='color: #0000BB'>openssl_pkcs7_encrypt</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'msg.txt'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'enc.txt'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$key</span><span style='color: #007700'>,<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;array(</span><span style='color: #DD0000'>'To'&amp;nbsp;</span><span style='color: #007700'>=&amp;gt;&amp;nbsp;</span><span style='color: #DD0000'>'nighthawk@example.com'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #FF8000'>//&amp;nbsp;keyed&amp;nbsp;syntax<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #DD0000'>'From:&amp;nbsp;HQ&amp;nbsp;&amp;lt;hq@example.com&amp;gt;'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #FF8000'>//&amp;nbsp;indexed&amp;nbsp;syntax<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #DD0000'>'Subject'&amp;nbsp;</span><span style='color: #007700'>=&amp;gt;&amp;nbsp;</span><span style='color: #DD0000'>'Eyes&amp;nbsp;only'</span><span style='color: #007700'>)))&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>//&amp;nbsp;message&amp;nbsp;encrypted&amp;nbsp;-&amp;nbsp;send&amp;nbsp;it!<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>exec</span><span style='color: #007700'>(</span><span style='color: #0000BB'>ini_get</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'sendmail_path'</span><span style='color: #007700'>)&amp;nbsp;.&amp;nbsp;</span><span style='color: #DD0000'>'&amp;nbsp;&amp;lt;&amp;nbsp;enc.txt'</span><span style='color: #007700'>);<br />}<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_pkcs7_decrypt" value="<div id='function.openssl-pkcs7-decrypt' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-pkcs7-decrypt.php'>openssl_pkcs7_decrypt</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.6, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_pkcs7_decrypt</span> &amp;mdash; <span class='dc-title'>Decrypts an S/MIME encrypted message</span></p> </div> <a name='function.openssl-pkcs7-decrypt.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_pkcs7_decrypt</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$infilename</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$outfilename</tt></span> , <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$recipcert</tt></span> [, <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$recipkey</tt></span> ] )</div> <p class='para rdfs-comment'> Decrypts the S/MIME encrypted message contained in the file specified by <i><tt class='parameter'>infilename</tt></i> using the certificate and its associated private key specified by <i><tt class='parameter'>recipcert</tt></i> and <i><tt class='parameter'>recipkey</tt></i> . </p> </div> <a name='function.openssl-pkcs7-decrypt.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>infilename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>outfilename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The decrypted message is written to the file specified by <i><tt class='parameter'>outfilename</tt></i> . </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>recipcert</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>recipkey</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-pkcs7-decrypt.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.openssl-pkcs7-decrypt.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>openssl_pkcs7_decrypt()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /></span><span style='color: #FF8000'>//&amp;nbsp;$cert&amp;nbsp;and&amp;nbsp;$key&amp;nbsp;are&amp;nbsp;assumed&amp;nbsp;to&amp;nbsp;contain&amp;nbsp;your&amp;nbsp;personal&amp;nbsp;certificate&amp;nbsp;and&amp;nbsp;private<br />//&amp;nbsp;key&amp;nbsp;pair,&amp;nbsp;and&amp;nbsp;that&amp;nbsp;you&amp;nbsp;are&amp;nbsp;the&amp;nbsp;recipient&amp;nbsp;of&amp;nbsp;an&amp;nbsp;S/MIME&amp;nbsp;message<br /></span><span style='color: #0000BB'>$infilename&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #DD0000'>'encrypted.msg'</span><span style='color: #007700'>;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>//&amp;nbsp;this&amp;nbsp;file&amp;nbsp;holds&amp;nbsp;your&amp;nbsp;encrypted&amp;nbsp;message<br /></span><span style='color: #0000BB'>$outfilename&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #DD0000'>'decrypted.msg'</span><span style='color: #007700'>;&amp;nbsp;</span><span style='color: #FF8000'>//&amp;nbsp;make&amp;nbsp;sure&amp;nbsp;you&amp;nbsp;can&amp;nbsp;write&amp;nbsp;to&amp;nbsp;this&amp;nbsp;file<br /><br /></span><span style='color: #007700'>if&amp;nbsp;(</span><span style='color: #0000BB'>openssl_pkcs7_decrypt</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$infilename</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$outfilename</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$cert</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$key</span><span style='color: #007700'>))&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #DD0000'>'decrypted!'</span><span style='color: #007700'>;<br />}&amp;nbsp;else&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #DD0000'>'failed&amp;nbsp;to&amp;nbsp;decrypt!'</span><span style='color: #007700'>;<br />}<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_pkcs12_read" value="<div id='function.openssl-pkcs12-read' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-pkcs12-read.php'>openssl_pkcs12_read</a></h1> <p class='verinfo'>(PHP 5 &amp;gt;= 5.2.2)</p><p class='refpurpose'><span class='refname'>openssl_pkcs12_read</span> &amp;mdash; <span class='dc-title'>Parse a PKCS#12 Certificate Store into an array</span></p> </div> <a name='function.openssl-pkcs12-read.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_pkcs12_read</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$pkcs12</tt></span> , <span class='methodparam'><span class='type'>array</span> <tt class='parameter reference'>&amp;amp;$certs</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$pass</tt></span> )</div> <p class='para rdfs-comment'> <b>openssl_pkcs12_read()</b> parses the PKCS#12 certificate store supplied by <i><tt class='parameter'>pkcs12</tt></i> into a array named <i><tt class='parameter'>certs</tt></i> . </p> </div> <a name='function.openssl-pkcs12-read.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>pkcs12</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>certs</tt></i> </span> </dt><dd class='listitem'> <p class='para'> On success, this will hold the Certificate Store Data. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>pass</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Encryption password for unlocking the PKCS#12 file. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-pkcs12-read.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_pkcs12_export_to_file" value="<div id='function.openssl-pkcs12-export-to-file' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-pkcs12-export-to-file.php'>openssl_pkcs12_export_to_file</a></h1> <p class='verinfo'>(PHP 5 &amp;gt;= 5.2.2)</p><p class='refpurpose'><span class='refname'>openssl_pkcs12_export_to_file</span> &amp;mdash; <span class='dc-title'>Exports a PKCS#12 Compatible Certificate Store File</span></p> </div> <a name='function.openssl-pkcs12-export-to-file.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_pkcs12_export_to_file</b></span> ( <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$x509</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$filename</tt></span> , <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$priv_key</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$pass</tt></span> [, <span class='methodparam'><span class='type'>array</span> <tt class='parameter'>$args</tt></span> ] )</div> <p class='para rdfs-comment'> <b>openssl_pkcs12_export_to_file()</b> stores <i><tt class='parameter'>x509</tt></i> into a file named by <i><tt class='parameter'>filename</tt></i> in a PKCS#12 file format. </p> </div> <a name='function.openssl-pkcs12-export-to-file.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>x509</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>filename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Path to the output file. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>priv_key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Private key component of PKCS#12 file. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>pass</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Encryption password for unlocking the PKCS#12 file. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>args</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-pkcs12-export-to-file.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_pkcs12_export" value="<div id='function.openssl-pkcs12-export' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-pkcs12-export.php'>openssl_pkcs12_export</a></h1> <p class='verinfo'>(PHP 5 &amp;gt;= 5.2.2)</p><p class='refpurpose'><span class='refname'>openssl_pkcs12_export</span> &amp;mdash; <span class='dc-title'>Exports a PKCS#12 Compatible Certificate Store File to variable.</span></p> </div> <a name='function.openssl-pkcs12-export.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_pkcs12_export</b></span> ( <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$x509</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter reference'>&amp;amp;$out</tt></span> , <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$priv_key</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$pass</tt></span> [, <span class='methodparam'><span class='type'>array</span> <tt class='parameter'>$args</tt></span> ] )</div> <p class='para rdfs-comment'> <b>openssl_pkcs12_export()</b> stores <i><tt class='parameter'>x509</tt></i> into a string named by <i><tt class='parameter'>out</tt></i> in a PKCS#12 file format. </p> </div> <a name='function.openssl-pkcs12-export.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>x509</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>out</tt></i> </span> </dt><dd class='listitem'> <p class='para'> On success, this will hold the PKCS#12. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>priv_key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Private key component of PKCS#12 file. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>pass</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Encryption password for unlocking the PKCS#12 file. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>args</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-pkcs12-export.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_open" value="<div id='function.openssl-open' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-open.php'>openssl_open</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_open</span> &amp;mdash; <span class='dc-title'>Open sealed data</span></p> </div> <a name='function.openssl-open.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_open</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$sealed_data</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter reference'>&amp;amp;$open_data</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$env_key</tt></span> , <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$priv_key_id</tt></span> )</div> <p class='para rdfs-comment'> <b>openssl_open()</b> opens (decrypts) <i><tt class='parameter'>sealed_data</tt></i> using the private key associated with the key identifier <i><tt class='parameter'>priv_key_id</tt></i> and the envelope key <i><tt class='parameter'>env_key</tt></i> , and fills <i><tt class='parameter'>open_data</tt></i> with the decrypted data. The envelope key is generated when the data are sealed and can only be used by one specific private key. See <a href='http://www.php.net/manual/en/function.openssl-seal.php' class='function'>openssl_seal()</a> for more information. </p> </div> <a name='function.openssl-open.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>sealed_data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>open_data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> If the call is successful the opened data is returned in this parameter. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>env_key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>priv_key_id</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-open.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.openssl-open.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>openssl_open()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /></span><span style='color: #FF8000'>//&amp;nbsp;$sealed&amp;nbsp;and&amp;nbsp;$env_key&amp;nbsp;are&amp;nbsp;assumed&amp;nbsp;to&amp;nbsp;contain&amp;nbsp;the&amp;nbsp;sealed&amp;nbsp;data<br />//&amp;nbsp;and&amp;nbsp;our&amp;nbsp;envelope&amp;nbsp;key,&amp;nbsp;both&amp;nbsp;given&amp;nbsp;to&amp;nbsp;us&amp;nbsp;by&amp;nbsp;the&amp;nbsp;sealer.<br /><br />//&amp;nbsp;fetch&amp;nbsp;private&amp;nbsp;key&amp;nbsp;from&amp;nbsp;file&amp;nbsp;and&amp;nbsp;ready&amp;nbsp;it<br /></span><span style='color: #0000BB'>$fp&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>fopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'/src/openssl-0.9.6/demos/sign/key.pem'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'r'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>$priv_key&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>fread</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>8192</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>fclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>$pkeyid&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>openssl_get_privatekey</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$priv_key</span><span style='color: #007700'>);<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;decrypt&amp;nbsp;the&amp;nbsp;data&amp;nbsp;and&amp;nbsp;store&amp;nbsp;it&amp;nbsp;in&amp;nbsp;$open<br /></span><span style='color: #007700'>if&amp;nbsp;(</span><span style='color: #0000BB'>openssl_open</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$sealed</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$open</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$env_key</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$pkeyid</span><span style='color: #007700'>))&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #DD0000'>'here&amp;nbsp;is&amp;nbsp;the&amp;nbsp;opened&amp;nbsp;data:&amp;nbsp;'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$open</span><span style='color: #007700'>;<br />}&amp;nbsp;else&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #DD0000'>'failed&amp;nbsp;to&amp;nbsp;open&amp;nbsp;data'</span><span style='color: #007700'>;<br />}<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;free&amp;nbsp;the&amp;nbsp;private&amp;nbsp;key&amp;nbsp;from&amp;nbsp;memory<br /></span><span style='color: #0000BB'>openssl_free_key</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$pkeyid</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.openssl-open.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-seal.php' class='function' rel='rdfs-seeAlso'>openssl_seal()</a> - Seal (encrypt) data</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_get_publickey" value="<div id='function.openssl-get-publickey' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-get-publickey.php'>openssl_get_publickey</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_get_publickey</span> &amp;mdash; <span class='dc-title'>Alias of <a href='http://www.php.net/manual/en/function.openssl-pkey-get-public.php' class='function'>openssl_pkey_get_public()</a></span></p> </div> <a name='function.openssl-get-publickey.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <p class='simpara'> This function is an alias of: <a href='http://www.php.net/manual/en/function.openssl-pkey-get-public.php' class='function'>openssl_pkey_get_public()</a>. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_get_privatekey" value="<div id='function.openssl-get-privatekey' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-get-privatekey.php'>openssl_get_privatekey</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_get_privatekey</span> &amp;mdash; <span class='dc-title'>Alias of <a href='http://www.php.net/manual/en/function.openssl-pkey-get-private.php' class='function'>openssl_pkey_get_private()</a></span></p> </div> <a name='function.openssl-get-privatekey.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <p class='simpara'> This function is an alias of: <a href='http://www.php.net/manual/en/function.openssl-pkey-get-private.php' class='function'>openssl_pkey_get_private()</a>. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_free_key" value="<div id='function.openssl-free-key' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-free-key.php'>openssl_free_key</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_free_key</span> &amp;mdash; <span class='dc-title'>Free key resource</span></p> </div> <a name='function.openssl-free-key.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'><span class='type void'>void</span></span> <span class='methodname'><b>openssl_free_key</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$key_identifier</tt></span> )</div> <p class='para rdfs-comment'> <b>openssl_free_key()</b> frees the key associated with the specified <i><tt class='parameter'>key_identifier</tt></i> from memory. </p> </div> <a name='function.openssl-free-key.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key_identifier</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-free-key.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> No value is returned. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_error_string" value="<div id='function.openssl-error-string' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-error-string.php'>openssl_error_string</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.6, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_error_string</span> &amp;mdash; <span class='dc-title'>Return openSSL error message</span></p> </div> <a name='function.openssl-error-string.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>openssl_error_string</b></span> ( <span class='methodparam'>void</span> )</div> <p class='para rdfs-comment'> <b>openssl_error_string()</b> returns the last error from the openSSL library. Error messages are stacked, so this function should be called multiple times to collect all of the information. </p> </div> <a name='function.openssl-error-string.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns an error message string, or <b><tt class='constant'>FALSE</tt></b> if there are no more error messages to return. </p> </div> <a name='function.openssl-error-string.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>openssl_error_string()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /></span><span style='color: #FF8000'>//&amp;nbsp;lets&amp;nbsp;assume&amp;nbsp;you&amp;nbsp;just&amp;nbsp;called&amp;nbsp;an&amp;nbsp;openssl&amp;nbsp;function&amp;nbsp;that&amp;nbsp;failed<br /></span><span style='color: #007700'>while&amp;nbsp;(</span><span style='color: #0000BB'>$msg&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>openssl_error_string</span><span style='color: #007700'>())<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #0000BB'>$msg&amp;nbsp;</span><span style='color: #007700'>.&amp;nbsp;</span><span style='color: #DD0000'>'&amp;lt;br&amp;nbsp;/&amp;gt;\n'</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_csr_sign" value="<div id='function.openssl-csr-sign' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-csr-sign.php'>openssl_csr_sign</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.2.0, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_csr_sign</span> &amp;mdash; <span class='dc-title'>Sign a CSR with another certificate (or itself) and generate a certificate</span></p> </div> <a name='function.openssl-csr-sign.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>resource</span> <span class='methodname'><b>openssl_csr_sign</b></span> ( <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$csr</tt></span> , <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$cacert</tt></span> , <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$priv_key</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$days</tt></span> [, <span class='methodparam'><span class='type'>array</span> <tt class='parameter'>$configargs</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$serial</tt><span class='initializer'> = 0</span></span> ]] )</div> <p class='para rdfs-comment'> <b>openssl_csr_sign()</b> generates an x509 certificate resource from the given CSR. </p> <blockquote><p><b class='note'>Note</b>: <span class='simpara'> You need to have a valid <var class='filename'>openssl.cnf</var> installed for this function to operate correctly. See the notes under <a href='http://www.php.net/manual/en/openssl.installation.php' class='link'>the installation section</a> for more information. </span> </p></blockquote> </div> <a name='function.openssl-csr-sign.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>csr</tt></i> </span> </dt><dd class='listitem'> <p class='para'> A CSR previously generated by <a href='http://www.php.net/manual/en/function.openssl-csr-new.php' class='function'>openssl_csr_new()</a>. It can also be the path to a PEM encoded CSR when specified as <var class='filename'>file://path/to/csr</var> or an exported string generated by <a href='http://www.php.net/manual/en/function.openssl-csr-export.php' class='function'>openssl_csr_export()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>cacert</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The generated certificate will be signed by <i><tt class='parameter'>cacert</tt></i> . If <i><tt class='parameter'>cacert</tt></i> is <b><tt class='constant'>NULL</tt></b>, the generated certificate will be a self-signed certificate. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>priv_key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>priv_key</tt></i> is the private key that corresponds to <i><tt class='parameter'>cacert</tt></i> . </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>days</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>days</tt></i> specifies the length of time for which the generated certificate will be valid, in days. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>configargs</tt></i> </span> </dt><dd class='listitem'> <p class='para'> You can finetune the CSR signing by <i><tt class='parameter'>configargs</tt></i> . See <a href='http://www.php.net/manual/en/function.openssl-csr-new.php' class='function'>openssl_csr_new()</a> for more information about <i><tt class='parameter'>configargs</tt></i> . </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>serial</tt></i> </span> </dt><dd class='listitem'> <p class='para'> An optional the serial number of issued certificate. If not specified it will default to 0. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-csr-sign.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns an x509 certificate resource on success, <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.openssl-csr-sign.changelog'></a><div class='refsect1 changelog'> <h3 class='title'>Changelog</h3> <p class='para'> </p><table class='doctable informaltable'> <thead valign='middle'> <tr valign='middle'> <th>Version</th> <th>Description</th> </tr> </thead> <tbody valign='middle' class='tbody'> <tr valign='middle'> <td align='left'>4.3.3</td> <td align='left'> The <i><tt class='parameter'>serial</tt></i> parameter was added. </td> </tr> </tbody> </table> <p> </p> </div> <a name='function.openssl-csr-sign.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>openssl_csr_sign()</b> example - signing a CSR (how to implement your own CA)</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /></span><span style='color: #FF8000'>//&amp;nbsp;Let's&amp;nbsp;assume&amp;nbsp;that&amp;nbsp;this&amp;nbsp;script&amp;nbsp;is&amp;nbsp;set&amp;nbsp;to&amp;nbsp;receive&amp;nbsp;a&amp;nbsp;CSR&amp;nbsp;that&amp;nbsp;has<br />//&amp;nbsp;been&amp;nbsp;pasted&amp;nbsp;into&amp;nbsp;a&amp;nbsp;textarea&amp;nbsp;from&amp;nbsp;another&amp;nbsp;page<br /></span><span style='color: #0000BB'>$csrdata&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>$_POST</span><span style='color: #007700'>[</span><span style='color: #DD0000'>'CSR'</span><span style='color: #007700'>];<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;We&amp;nbsp;will&amp;nbsp;sign&amp;nbsp;the&amp;nbsp;request&amp;nbsp;using&amp;nbsp;our&amp;nbsp;own&amp;nbsp;'certificate&amp;nbsp;authority'<br />//&amp;nbsp;certificate.&amp;nbsp;&amp;nbsp;You&amp;nbsp;can&amp;nbsp;use&amp;nbsp;any&amp;nbsp;certificate&amp;nbsp;to&amp;nbsp;sign&amp;nbsp;another,&amp;nbsp;but<br />//&amp;nbsp;the&amp;nbsp;process&amp;nbsp;is&amp;nbsp;worthless&amp;nbsp;unless&amp;nbsp;the&amp;nbsp;signing&amp;nbsp;certificate&amp;nbsp;is&amp;nbsp;trusted<br />//&amp;nbsp;by&amp;nbsp;the&amp;nbsp;software/users&amp;nbsp;that&amp;nbsp;will&amp;nbsp;deal&amp;nbsp;with&amp;nbsp;the&amp;nbsp;newly&amp;nbsp;signed&amp;nbsp;certificate<br /><br />//&amp;nbsp;We&amp;nbsp;need&amp;nbsp;our&amp;nbsp;CA&amp;nbsp;cert&amp;nbsp;and&amp;nbsp;its&amp;nbsp;private&amp;nbsp;key<br /></span><span style='color: #0000BB'>$cacert&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #DD0000'>'file://path/to/ca.crt'</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>$privkey&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;array(</span><span style='color: #DD0000'>'file://path/to/ca.key'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'your_ca_key_passphrase'</span><span style='color: #007700'>);<br /><br /></span><span style='color: #0000BB'>$userscert&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>openssl_csr_sign</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$csrdata</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$cacert</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$privkey</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>365</span><span style='color: #007700'>);<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;Now&amp;nbsp;display&amp;nbsp;the&amp;nbsp;generated&amp;nbsp;certificate&amp;nbsp;so&amp;nbsp;that&amp;nbsp;the&amp;nbsp;user&amp;nbsp;can<br />//&amp;nbsp;copy&amp;nbsp;and&amp;nbsp;paste&amp;nbsp;it&amp;nbsp;into&amp;nbsp;their&amp;nbsp;local&amp;nbsp;configuration&amp;nbsp;(such&amp;nbsp;as&amp;nbsp;a&amp;nbsp;file<br />//&amp;nbsp;to&amp;nbsp;hold&amp;nbsp;the&amp;nbsp;certificate&amp;nbsp;for&amp;nbsp;their&amp;nbsp;SSL&amp;nbsp;server)<br /></span><span style='color: #0000BB'>openssl_x509_export</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$usercert</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$certout</span><span style='color: #007700'>);<br />echo&amp;nbsp;</span><span style='color: #0000BB'>$certout</span><span style='color: #007700'>;<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;Show&amp;nbsp;any&amp;nbsp;errors&amp;nbsp;that&amp;nbsp;occurred&amp;nbsp;here<br /></span><span style='color: #007700'>while&amp;nbsp;((</span><span style='color: #0000BB'>$e&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>openssl_error_string</span><span style='color: #007700'>())&amp;nbsp;!==&amp;nbsp;</span><span style='color: #0000BB'>false</span><span style='color: #007700'>)&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #0000BB'>$e&amp;nbsp;</span><span style='color: #007700'>.&amp;nbsp;</span><span style='color: #DD0000'>'\n'</span><span style='color: #007700'>;<br />}<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_csr_new" value="<div id='function.openssl-csr-new' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-csr-new.php'>openssl_csr_new</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.2.0, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_csr_new</span> &amp;mdash; <span class='dc-title'>Generates a CSR</span></p> </div> <a name='function.openssl-csr-new.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <span class='methodname'><b>openssl_csr_new</b></span> ( <span class='methodparam'><span class='type'>array</span> <tt class='parameter'>$dn</tt></span> , <span class='methodparam'><span class='type'>resource</span> <tt class='parameter reference'>&amp;amp;$privkey</tt></span> [, <span class='methodparam'><span class='type'>array</span> <tt class='parameter'>$configargs</tt></span> [, <span class='methodparam'><span class='type'>array</span> <tt class='parameter'>$extraattribs</tt></span> ]] )</div> <p class='para rdfs-comment'> <b>openssl_csr_new()</b> generates a new CSR (Certificate Signing Request) based on the information provided by <i><tt class='parameter'>dn</tt></i> , which represents the Distinguished Name to be used in the certificate. </p> <blockquote><p><b class='note'>Note</b>: <span class='simpara'> You need to have a valid <var class='filename'>openssl.cnf</var> installed for this function to operate correctly. See the notes under <a href='http://www.php.net/manual/en/openssl.installation.php' class='link'>the installation section</a> for more information. </span> </p></blockquote> </div> <a name='function.openssl-csr-new.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>dn</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The Distinguished Name to be used in the certificate. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>privkey</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>privkey</tt></i> should be set to a private key that was previously generated by <a href='http://www.php.net/manual/en/function.openssl-pkey-new.php' class='function'>openssl_pkey_new()</a> (or otherwise obtained from the other openssl_pkey family of functions). The corresponding public portion of the key will be used to sign the CSR. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>configargs</tt></i> </span> </dt><dd class='listitem'> <p class='para'> By default, the information in your system <i>openssl.conf</i> is used to initialize the request; you can specify a configuration file section by setting the <i>config_section_section</i> key of <i><tt class='parameter'>configargs</tt></i> . You can also specify an alternative openssl configuration file by setting the value of the <i>config</i> key to the path of the file you want to use. The following keys, if present in <i><tt class='parameter'>configargs</tt></i> behave as their equivalents in the <i>openssl.conf</i>, as listed in the table below. </p><table class='doctable table'> <caption><b>Configuration overrides</b></caption> <thead valign='middle'> <tr valign='middle'> <th><i><tt class='parameter'>configargs</tt></i> key</th> <th>type</th> <th><i>openssl.conf</i> equivalent</th> <th>description</th> </tr> </thead> <tbody valign='middle' class='tbody'> <tr valign='middle'> <td align='left'>digest_alg</td> <td align='left'><a href='http://www.php.net/manual/en/language.types.string.php' class='type string'>string</a></td> <td align='left'>default_md</td> <td align='left'>Selects which digest method to use</td> </tr> <tr valign='middle'> <td align='left'>x509_extensions</td> <td align='left'><a href='http://www.php.net/manual/en/language.types.string.php' class='type string'>string</a></td> <td align='left'>x509_extensions</td> <td align='left'>Selects which extensions should be used when creating an x509 certificate</td> </tr> <tr valign='middle'> <td align='left'>req_extensions</td> <td align='left'><a href='http://www.php.net/manual/en/language.types.string.php' class='type string'>string</a></td> <td align='left'>req_extensions</td> <td align='left'>Selects which extensions should be used when creating a CSR</td> </tr> <tr valign='middle'> <td align='left'>private_key_bits</td> <td align='left'><a href='http://www.php.net/manual/en/language.types.integer.php' class='type integer'>integer</a></td> <td align='left'>default_bits</td> <td align='left'>Specifies how many bits should be used to generate a private key</td> </tr> <tr valign='middle'> <td align='left'>private_key_type</td> <td align='left'><a href='http://www.php.net/manual/en/language.types.integer.php' class='type integer'>integer</a></td> <td align='left'>none</td> <td align='left'>Specifies the type of private key to create. This can be one of <b><tt class='constant'>OPENSSL_KEYTYPE_DSA</tt></b>, <b><tt class='constant'>OPENSSL_KEYTYPE_DH</tt></b> or <b><tt class='constant'>OPENSSL_KEYTYPE_RSA</tt></b>. The default value is <b><tt class='constant'>OPENSSL_KEYTYPE_RSA</tt></b> which is currently the only supported key type. </td> </tr> <tr valign='middle'> <td align='left'>encrypt_key</td> <td align='left'><a href='http://www.php.net/manual/en/language.types.boolean.php' class='type boolean'>boolean</a></td> <td align='left'>encrypt_key</td> <td align='left'>Should an exported key (with passphrase) be encrypted?</td> </tr> </tbody> </table> <p> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>extraattribs</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>extraattribs</tt></i> is used to specify additional configuration options for the CSR. Both <i><tt class='parameter'>dn</tt></i> and <i><tt class='parameter'>extraattribs</tt></i> are associative arrays whose keys are converted to OIDs and applied to the relevant part of the request. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-csr-new.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the CSR. </p> </div> <a name='function.openssl-csr-new.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 Creating a self-signed-certificate</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /></span><span style='color: #FF8000'>//&amp;nbsp;Fill&amp;nbsp;in&amp;nbsp;data&amp;nbsp;for&amp;nbsp;the&amp;nbsp;distinguished&amp;nbsp;name&amp;nbsp;to&amp;nbsp;be&amp;nbsp;used&amp;nbsp;in&amp;nbsp;the&amp;nbsp;cert<br />//&amp;nbsp;You&amp;nbsp;must&amp;nbsp;change&amp;nbsp;the&amp;nbsp;values&amp;nbsp;of&amp;nbsp;these&amp;nbsp;keys&amp;nbsp;to&amp;nbsp;match&amp;nbsp;your&amp;nbsp;name&amp;nbsp;and<br />//&amp;nbsp;company,&amp;nbsp;or&amp;nbsp;more&amp;nbsp;precisely,&amp;nbsp;the&amp;nbsp;name&amp;nbsp;and&amp;nbsp;company&amp;nbsp;of&amp;nbsp;the&amp;nbsp;person/site<br />//&amp;nbsp;that&amp;nbsp;you&amp;nbsp;are&amp;nbsp;generating&amp;nbsp;the&amp;nbsp;certificate&amp;nbsp;for.<br />//&amp;nbsp;For&amp;nbsp;SSL&amp;nbsp;certificates,&amp;nbsp;the&amp;nbsp;commonName&amp;nbsp;is&amp;nbsp;usually&amp;nbsp;the&amp;nbsp;domain&amp;nbsp;name&amp;nbsp;of<br />//&amp;nbsp;that&amp;nbsp;will&amp;nbsp;be&amp;nbsp;using&amp;nbsp;the&amp;nbsp;certificate,&amp;nbsp;but&amp;nbsp;for&amp;nbsp;S/MIME&amp;nbsp;certificates,<br />//&amp;nbsp;the&amp;nbsp;commonName&amp;nbsp;will&amp;nbsp;be&amp;nbsp;the&amp;nbsp;name&amp;nbsp;of&amp;nbsp;the&amp;nbsp;individual&amp;nbsp;who&amp;nbsp;will&amp;nbsp;use&amp;nbsp;the<br />//&amp;nbsp;certificate.<br /></span><span style='color: #0000BB'>$dn&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;array(<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #DD0000'>'countryName'&amp;nbsp;</span><span style='color: #007700'>=&amp;gt;&amp;nbsp;</span><span style='color: #DD0000'>'UK'</span><span style='color: #007700'>,<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #DD0000'>'stateOrProvinceName'&amp;nbsp;</span><span style='color: #007700'>=&amp;gt;&amp;nbsp;</span><span style='color: #DD0000'>'Somerset'</span><span style='color: #007700'>,<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #DD0000'>'localityName'&amp;nbsp;</span><span style='color: #007700'>=&amp;gt;&amp;nbsp;</span><span style='color: #DD0000'>'Glastonbury'</span><span style='color: #007700'>,<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #DD0000'>'organizationName'&amp;nbsp;</span><span style='color: #007700'>=&amp;gt;&amp;nbsp;</span><span style='color: #DD0000'>'The&amp;nbsp;Brain&amp;nbsp;Room&amp;nbsp;Limited'</span><span style='color: #007700'>,<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #DD0000'>'organizationalUnitName'&amp;nbsp;</span><span style='color: #007700'>=&amp;gt;&amp;nbsp;</span><span style='color: #DD0000'>'PHP&amp;nbsp;Documentation&amp;nbsp;Team'</span><span style='color: #007700'>,<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #DD0000'>'commonName'&amp;nbsp;</span><span style='color: #007700'>=&amp;gt;&amp;nbsp;</span><span style='color: #DD0000'>'Wez&amp;nbsp;Furlong'</span><span style='color: #007700'>,<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #DD0000'>'emailAddress'&amp;nbsp;</span><span style='color: #007700'>=&amp;gt;&amp;nbsp;</span><span style='color: #DD0000'>'wez@example.com'<br /></span><span style='color: #007700'>);<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;Generate&amp;nbsp;a&amp;nbsp;new&amp;nbsp;private&amp;nbsp;(and&amp;nbsp;public)&amp;nbsp;key&amp;nbsp;pair<br /></span><span style='color: #0000BB'>$privkey&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>openssl_pkey_new</span><span style='color: #007700'>();<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;Generate&amp;nbsp;a&amp;nbsp;certificate&amp;nbsp;signing&amp;nbsp;request<br /></span><span style='color: #0000BB'>$csr&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>openssl_csr_new</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$dn</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$privkey</span><span style='color: #007700'>);<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;You&amp;nbsp;will&amp;nbsp;usually&amp;nbsp;want&amp;nbsp;to&amp;nbsp;create&amp;nbsp;a&amp;nbsp;self-signed&amp;nbsp;certificate&amp;nbsp;at&amp;nbsp;this<br />//&amp;nbsp;point&amp;nbsp;until&amp;nbsp;your&amp;nbsp;CA&amp;nbsp;fulfills&amp;nbsp;your&amp;nbsp;request.<br />//&amp;nbsp;This&amp;nbsp;creates&amp;nbsp;a&amp;nbsp;self-signed&amp;nbsp;cert&amp;nbsp;that&amp;nbsp;is&amp;nbsp;valid&amp;nbsp;for&amp;nbsp;365&amp;nbsp;days<br /></span><span style='color: #0000BB'>$sscert&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>openssl_csr_sign</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$csr</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>null</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$privkey</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>365</span><span style='color: #007700'>);<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;Now&amp;nbsp;you&amp;nbsp;will&amp;nbsp;want&amp;nbsp;to&amp;nbsp;preserve&amp;nbsp;your&amp;nbsp;private&amp;nbsp;key,&amp;nbsp;CSR&amp;nbsp;and&amp;nbsp;self-signed<br />//&amp;nbsp;cert&amp;nbsp;so&amp;nbsp;that&amp;nbsp;they&amp;nbsp;can&amp;nbsp;be&amp;nbsp;installed&amp;nbsp;into&amp;nbsp;your&amp;nbsp;web&amp;nbsp;server,&amp;nbsp;mail&amp;nbsp;server<br />//&amp;nbsp;or&amp;nbsp;mail&amp;nbsp;client&amp;nbsp;(depending&amp;nbsp;on&amp;nbsp;the&amp;nbsp;intended&amp;nbsp;use&amp;nbsp;of&amp;nbsp;the&amp;nbsp;certificate).<br />//&amp;nbsp;This&amp;nbsp;example&amp;nbsp;shows&amp;nbsp;how&amp;nbsp;to&amp;nbsp;get&amp;nbsp;those&amp;nbsp;things&amp;nbsp;into&amp;nbsp;variables,&amp;nbsp;but&amp;nbsp;you<br />//&amp;nbsp;can&amp;nbsp;also&amp;nbsp;store&amp;nbsp;them&amp;nbsp;directly&amp;nbsp;into&amp;nbsp;files.<br />//&amp;nbsp;Typically,&amp;nbsp;you&amp;nbsp;will&amp;nbsp;send&amp;nbsp;the&amp;nbsp;CSR&amp;nbsp;on&amp;nbsp;to&amp;nbsp;your&amp;nbsp;CA&amp;nbsp;who&amp;nbsp;will&amp;nbsp;then&amp;nbsp;issue<br />//&amp;nbsp;you&amp;nbsp;with&amp;nbsp;the&amp;nbsp;'real'&amp;nbsp;certificate.<br /></span><span style='color: #0000BB'>openssl_csr_export</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$csr</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$csrout</span><span style='color: #007700'>)&amp;nbsp;and&amp;nbsp;</span><span style='color: #0000BB'>var_dump</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$csrout</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>openssl_x509_export</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$sscert</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$certout</span><span style='color: #007700'>)&amp;nbsp;and&amp;nbsp;</span><span style='color: #0000BB'>var_dump</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$certout</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>openssl_pkey_export</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$privkey</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$pkeyout</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'mypassword'</span><span style='color: #007700'>)&amp;nbsp;and&amp;nbsp;</span><span style='color: #0000BB'>var_dump</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$pkeyout</span><span style='color: #007700'>);<br /><br /></span><span style='color: #FF8000'>//&amp;nbsp;Show&amp;nbsp;any&amp;nbsp;errors&amp;nbsp;that&amp;nbsp;occurred&amp;nbsp;here<br /></span><span style='color: #007700'>while&amp;nbsp;((</span><span style='color: #0000BB'>$e&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>openssl_error_string</span><span style='color: #007700'>())&amp;nbsp;!==&amp;nbsp;</span><span style='color: #0000BB'>false</span><span style='color: #007700'>)&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #0000BB'>$e&amp;nbsp;</span><span style='color: #007700'>.&amp;nbsp;</span><span style='color: #DD0000'>'\n'</span><span style='color: #007700'>;<br />}<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_csr_get_subject" value="<div id='function.openssl-csr-get-subject' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-csr-get-subject.php'>openssl_csr_get_subject</a></h1> <p class='verinfo'>(PHP 5 &amp;gt;= 5.2.0)</p><p class='refpurpose'><span class='refname'>openssl_csr_get_subject</span> &amp;mdash; <span class='dc-title'>Returns the subject of a CERT</span></p> </div> <a name='function.openssl-csr-get-subject.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>array</span> <span class='methodname'><b>openssl_csr_get_subject</b></span> ( <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$csr</tt></span> [, <span class='methodparam'><span class='type'>bool</span> <tt class='parameter'>$use_shortnames</tt><span class='initializer'> = true</span></span> ] )</div> <div class='warning'><b class='warning'>Warning</b><p class='simpara'>This function is currently not documented; only its argument list is available. </p></div> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_csr_get_public_key" value="<div id='function.openssl-csr-get-public-key' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-csr-get-public-key.php'>openssl_csr_get_public_key</a></h1> <p class='verinfo'>(PHP 5 &amp;gt;= 5.2.0)</p><p class='refpurpose'><span class='refname'>openssl_csr_get_public_key</span> &amp;mdash; <span class='dc-title'>Returns the public key of a CERT</span></p> </div> <a name='function.openssl-csr-get-public-key.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>resource</span> <span class='methodname'><b>openssl_csr_get_public_key</b></span> ( <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$csr</tt></span> [, <span class='methodparam'><span class='type'>bool</span> <tt class='parameter'>$use_shortnames</tt><span class='initializer'> = true</span></span> ] )</div> <div class='warning'><b class='warning'>Warning</b><p class='simpara'>This function is currently not documented; only its argument list is available. </p></div> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_csr_export_to_file" value="<div id='function.openssl-csr-export-to-file' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-csr-export-to-file.php'>openssl_csr_export_to_file</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.2.0, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_csr_export_to_file</span> &amp;mdash; <span class='dc-title'>Exports a CSR to a file</span></p> </div> <a name='function.openssl-csr-export-to-file.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_csr_export_to_file</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$csr</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$outfilename</tt></span> [, <span class='methodparam'><span class='type'>bool</span> <tt class='parameter'>$notext</tt><span class='initializer'> = true</span></span> ] )</div> <p class='para rdfs-comment'> <b>openssl_csr_export_to_file()</b> takes the Certificate Signing Request represented by <i><tt class='parameter'>csr</tt></i> and saves it as ascii-armoured text into the file named by <i><tt class='parameter'>outfilename</tt></i> . </p> </div> <a name='function.openssl-csr-export-to-file.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>csr</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>outfilename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Path to the output file. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>notext</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The optional parameter <i><tt class='parameter'>notext</tt></i> affects the verbosity of the output; if it is <b><tt class='constant'>FALSE</tt></b>, then additional human-readable information is included in the output. The default value of <i><tt class='parameter'>notext</tt></i> is <b><tt class='constant'>TRUE</tt></b>. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-csr-export-to-file.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.openssl-csr-export-to-file.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-csr-export.php' class='function' rel='rdfs-seeAlso'>openssl_csr_export()</a> - Exports a CSR as a string</li> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-csr-new.php' class='function' rel='rdfs-seeAlso'>openssl_csr_new()</a> - Generates a CSR</li> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-csr-sign.php' class='function' rel='rdfs-seeAlso'>openssl_csr_sign()</a> - Sign a CSR with another certificate (or itself) and generate a certificate</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="openssl_csr_export" value="<div id='function.openssl-csr-export' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.openssl-csr-export.php'>openssl_csr_export</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.2.0, PHP 5)</p><p class='refpurpose'><span class='refname'>openssl_csr_export</span> &amp;mdash; <span class='dc-title'>Exports a CSR as a string</span></p> </div> <a name='function.openssl-csr-export.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>openssl_csr_export</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$csr</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter reference'>&amp;amp;$out</tt></span> [, <span class='methodparam'><span class='type'>bool</span> <tt class='parameter'>$notext</tt><span class='initializer'> = true</span></span> ] )</div> <p class='para rdfs-comment'> <b>openssl_csr_export()</b> takes the Certificate Signing Request represented by <i><tt class='parameter'>csr</tt></i> and stores it as ascii-armoured text into <i><tt class='parameter'>out</tt></i> , which is passed by reference. </p> </div> <a name='function.openssl-csr-export.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>csr</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>out</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>notext</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The optional parameter <i><tt class='parameter'>notext</tt></i> affects the verbosity of the output; if it is <b><tt class='constant'>FALSE</tt></b>, then additional human-readable information is included in the output. The default value of <i><tt class='parameter'>notext</tt></i> is <b><tt class='constant'>TRUE</tt></b>. </p> </dd> </dl> <p> </p> </div> <a name='function.openssl-csr-export.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.openssl-csr-export.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-csr-export-to-file.php' class='function' rel='rdfs-seeAlso'>openssl_csr_export_to_file()</a> - Exports a CSR to a file</li> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-csr-new.php' class='function' rel='rdfs-seeAlso'>openssl_csr_new()</a> - Generates a CSR</li> <li class='member'><a href='http://www.php.net/manual/en/function.openssl-csr-sign.php' class='function' rel='rdfs-seeAlso'>openssl_csr_sign()</a> - Sign a CSR with another certificate (or itself) and generate a certificate</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="ob_gzhandler" value="<div id='function.ob-gzhandler' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.ob-gzhandler.php'>ob_gzhandler</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>ob_gzhandler</span> &amp;mdash; <span class='dc-title'>ob_start callback function to gzip output buffer</span></p> </div> <a name='function.ob-gzhandler.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>ob_gzhandler</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$buffer</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$mode</tt></span> )</div> <p class='para rdfs-comment'> <b>ob_gzhandler()</b> is intended to be used as a callback function for <a href='http://www.php.net/manual/en/function.ob-start.php' class='function'>ob_start()</a> to help facilitate sending gz-encoded data to web browsers that support compressed web pages. Before <b>ob_gzhandler()</b> actually sends compressed data, it determines what type of content encoding the browser will accept (&amp;quot;gzip&amp;quot;, &amp;quot;deflate&amp;quot; or none at all) and will return its output accordingly. All browsers are supported since it&amp;#039;s up to the browser to send the correct header saying that it accepts compressed web pages. If a browser doesn&amp;#039;t support compressed pages this function returns <b><tt class='constant'>FALSE</tt></b>. </p> </div> <a name='function.ob-gzhandler.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>buffer</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>mode</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> </dl> <p> </p> </div> <a name='function.ob-gzhandler.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> </p> </div> <a name='function.ob-gzhandler.changelog'></a><div class='refsect1 changelog'> <h3 class='title'>Changelog</h3> <p class='para'> </p><table class='doctable informaltable'> <thead valign='middle'> <tr valign='middle'> <th>Version</th> <th>Description</th> </tr> </thead> <tbody valign='middle' class='tbody'> <tr valign='middle'> <td align='left'>4.0.5</td> <td align='left'> The <i><tt class='parameter'>mode</tt></i> parameter was added. </td> </tr> </tbody> </table> <p> </p> </div> <a name='function.ob-gzhandler.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>ob_gzhandler()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /><br />ob_start</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'ob_gzhandler'</span><span style='color: #007700'>);<br /><br /></span><span style='color: #0000BB'>?&amp;gt;<br /></span>&amp;lt;html&amp;gt;<br />&amp;lt;body&amp;gt;<br />&amp;lt;p&amp;gt;This&amp;nbsp;should&amp;nbsp;be&amp;nbsp;a&amp;nbsp;compressed&amp;nbsp;page.&amp;lt;/p&amp;gt;<br />&amp;lt;/html&amp;gt;<br />&amp;lt;body&amp;gt;</span> </code></div> </div> </div><p> </p> </div> <a name='function.ob-gzhandler.notes'></a><div class='refsect1 notes'> <h3 class='title'>Notes</h3> <blockquote><p><b class='note'>Note</b>: <b>ob_gzhandler()</b> requires the <a href='http://www.php.net/manual/en/ref.zlib.php' class='link'>zlib</a> extension. <br /> </p></blockquote> <blockquote><p><b class='note'>Note</b>: You cannot use both <b>ob_gzhandler()</b> and <a href='http://www.php.net/manual/en/zlib.configuration.php#ini.zlib.output-compression' class='link'>zlib.output_compression</a>. Also note that using <a href='http://www.php.net/manual/en/zlib.configuration.php#ini.zlib.output-compression' class='link'> zlib.output_compression</a> is preferred over <b>ob_gzhandler()</b>. <br /> </p></blockquote> </div> <a name='function.ob-gzhandler.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.ob-start.php' class='function' rel='rdfs-seeAlso'>ob_start()</a> - Turn on output buffering</li> <li class='member'><a href='http://www.php.net/manual/en/function.ob-end-flush.php' class='function' rel='rdfs-seeAlso'>ob_end_flush()</a> - Flush (send) the output buffer and turn off output buffering</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mhash_keygen_s2k" value="<div id='function.mhash-keygen-s2k' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mhash-keygen-s2k.php'>mhash_keygen_s2k</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>mhash_keygen_s2k</span> &amp;mdash; <span class='dc-title'>Generates a key</span></p> </div> <a name='function.mhash-keygen-s2k.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mhash_keygen_s2k</b></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$hash</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$password</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$salt</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$bytes</tt></span> )</div> <p class='para rdfs-comment'> Generates a key according to the <i><tt class='parameter'>hash</tt></i> given a user provided <i><tt class='parameter'>password</tt></i> . </p> <p class='para'> This is the Salted S2K algorithm as specified in the OpenPGP document (<a href='http://www.faqs.org/rfcs/rfc2440' class='link external'>&amp;raquo; RFC 2440</a>). </p> <p class='para'> Keep in mind that user supplied passwords are not really suitable to be used as keys in cryptographic algorithms, since users normally choose keys they can write on keyboard. These passwords use only 6 to 7 bits per character (or less). It is highly recommended to use some kind of transformation (like this function) to the user supplied key. </p> </div> <a name='function.mhash-keygen-s2k.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>hash</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The hash id used to create the key. One of the <i>MHASH_XXX</i> constants. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>password</tt></i> </span> </dt><dd class='listitem'> <p class='para'> User supplied password. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>salt</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Must be different and random enough for every key you generate in order to create different keys. That salt must be known when you check the keys, thus it is a good idea to append the key to it. Salt has a fixed length of 8 bytes and will be padded with zeros if you supply less bytes. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>bytes</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The key length, in bytes. </p> </dd> </dl> <p> </p> </div> <a name='function.mhash-keygen-s2k.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the generated key as a string, or <b><tt class='constant'>FALSE</tt></b> on error. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mhash_get_hash_name" value="<div id='function.mhash-get-hash-name' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mhash-get-hash-name.php'>mhash_get_hash_name</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>mhash_get_hash_name</span> &amp;mdash; <span class='dc-title'>Get the name of the specified hash</span></p> </div> <a name='function.mhash-get-hash-name.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mhash_get_hash_name</b></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$hash</tt></span> )</div> <p class='para rdfs-comment'> Gets the name of the specified <i><tt class='parameter'>hash</tt></i> . </p> </div> <a name='function.mhash-get-hash-name.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>hash</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The hash id. One of the <i>MHASH_XXX</i> constants. </p> </dd> </dl> <p> </p> </div> <a name='function.mhash-get-hash-name.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the name of the hash or <b><tt class='constant'>FALSE</tt></b>, if the hash does not exist. </p> </div> <a name='function.mhash-get-hash-name.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>mhash_get_hash_name()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /><br /></span><span style='color: #007700'>echo&amp;nbsp;</span><span style='color: #0000BB'>mhash_get_hash_name</span><span style='color: #007700'>(</span><span style='color: #0000BB'>MHASH_MD5</span><span style='color: #007700'>);&amp;nbsp;</span><span style='color: #FF8000'>//&amp;nbsp;MD5<br /><br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mhash_get_block_size" value="<div id='function.mhash-get-block-size' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mhash-get-block-size.php'>mhash_get_block_size</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>mhash_get_block_size</span> &amp;mdash; <span class='dc-title'>Get the block size of the specified hash</span></p> </div> <a name='function.mhash-get-block-size.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>mhash_get_block_size</b></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$hash</tt></span> )</div> <p class='para rdfs-comment'> Gets the size of a block of the specified <i><tt class='parameter'>hash</tt></i> . </p> </div> <a name='function.mhash-get-block-size.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>hash</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The hash id. One of the <i>MHASH_XXX</i> constants. </p> </dd> </dl> <p> </p> </div> <a name='function.mhash-get-block-size.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the size in bytes or <b><tt class='constant'>FALSE</tt></b>, if the <i><tt class='parameter'>hash</tt></i> does not exist. </p> </div> <a name='function.mhash-get-block-size.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>mhash_get_block_size()</b> Example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /><br /></span><span style='color: #007700'>echo&amp;nbsp;</span><span style='color: #0000BB'>mhash_get_block_size</span><span style='color: #007700'>(</span><span style='color: #0000BB'>MHASH_MD5</span><span style='color: #007700'>);&amp;nbsp;</span><span style='color: #FF8000'>//&amp;nbsp;16<br /><br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mhash_count" value="<div id='function.mhash-count' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mhash-count.php'>mhash_count</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>mhash_count</span> &amp;mdash; <span class='dc-title'>Get the highest available hash id</span></p> </div> <a name='function.mhash-count.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>mhash_count</b></span> ( <span class='methodparam'>void</span> )</div> <p class='para rdfs-comment'> Gets the highest available hash id. </p> </div> <a name='function.mhash-count.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the highest available hash id. Hashes are numbered from 0 to this hash id. </p> </div> <a name='function.mhash-count.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 Traversing all hashes</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /><br />$nr&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mhash_count</span><span style='color: #007700'>();<br /><br />for&amp;nbsp;(</span><span style='color: #0000BB'>$i&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>0</span><span style='color: #007700'>;&amp;nbsp;</span><span style='color: #0000BB'>$i&amp;nbsp;</span><span style='color: #007700'>&amp;lt;=&amp;nbsp;</span><span style='color: #0000BB'>$nr</span><span style='color: #007700'>;&amp;nbsp;</span><span style='color: #0000BB'>$i</span><span style='color: #007700'>++)&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #0000BB'>sprintf</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'The&amp;nbsp;blocksize&amp;nbsp;of&amp;nbsp;%s&amp;nbsp;is&amp;nbsp;%d\n'</span><span style='color: #007700'>,<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>mhash_get_hash_name</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$i</span><span style='color: #007700'>),<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>mhash_get_block_size</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$i</span><span style='color: #007700'>));<br />}<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mhash" value="<div id='function.mhash' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mhash.php'>mhash</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>mhash</span> &amp;mdash; <span class='dc-title'>Compute hash</span></p> </div> <a name='function.mhash.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mhash</b></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$hash</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$key</tt></span> ] )</div> <p class='para rdfs-comment'> <b>mhash()</b> applies a hash function specified by <i><tt class='parameter'>hash</tt></i> to the <i><tt class='parameter'>data</tt></i> . </p> </div> <a name='function.mhash.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>hash</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The hash id. One of the <i>MHASH_XXX</i> constants. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The user input, as a string. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> If specified, the function will return the resulting HMAC instead. HMAC is keyed hashing for message authentication, or simply a message digest that depends on the specified key. Not all algorithms supported in mhash can be used in HMAC mode. </p> </dd> </dl> <p> </p> </div> <a name='function.mhash.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the resulting hash (also called digest) or HMAC as a string, or <b><tt class='constant'>FALSE</tt></b> on errors. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mdecrypt_generic" value="<div id='function.mdecrypt-generic' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mdecrypt-generic.php'>mdecrypt_generic</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mdecrypt_generic</span> &amp;mdash; <span class='dc-title'>Decrypt data</span></p> </div> <a name='function.mdecrypt-generic.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mdecrypt_generic</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$td</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> )</div> <p class='para rdfs-comment'> This function decrypts data. Note that the length of the returned string can in fact be longer then the unencrypted string, due to the padding of the data. </p> </div> <a name='function.mdecrypt-generic.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>td</tt></i> </span> </dt><dd class='listitem'> <p class='para'> An encryption descriptor returned by <a href='http://www.php.net/manual/en/function.mcrypt-module-open.php' class='function'>mcrypt_module_open()</a> </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Encrypted data. </p> </dd> </dl> <p> </p> </div> <a name='function.mdecrypt-generic.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>mdecrypt_generic()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>/*&amp;nbsp;Data&amp;nbsp;*/<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$key&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #DD0000'>'this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;very&amp;nbsp;long&amp;nbsp;key,&amp;nbsp;even&amp;nbsp;too&amp;nbsp;long&amp;nbsp;for&amp;nbsp;the&amp;nbsp;cipher'</span><span style='color: #007700'>;<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$plain_text&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #DD0000'>'very&amp;nbsp;important&amp;nbsp;data'</span><span style='color: #007700'>;<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>/*&amp;nbsp;Open&amp;nbsp;module,&amp;nbsp;and&amp;nbsp;create&amp;nbsp;IV&amp;nbsp;*/<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$td&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_module_open</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'des'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'ecb'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$key&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>substr</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$key</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>0</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_enc_get_key_size</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>));<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$iv_size&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_enc_get_iv_size</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$iv&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_create_iv</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$iv_size</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>MCRYPT_RAND</span><span style='color: #007700'>);<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>/*&amp;nbsp;Initialize&amp;nbsp;encryption&amp;nbsp;handle&amp;nbsp;*/<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #007700'>if&amp;nbsp;(</span><span style='color: #0000BB'>mcrypt_generic_init</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$key</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$iv</span><span style='color: #007700'>)&amp;nbsp;!=&amp;nbsp;-</span><span style='color: #0000BB'>1</span><span style='color: #007700'>)&amp;nbsp;{<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>/*&amp;nbsp;Encrypt&amp;nbsp;data&amp;nbsp;*/<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$c_t&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_generic</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$plain_text</span><span style='color: #007700'>);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_generic_deinit</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>);<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>/*&amp;nbsp;Reinitialize&amp;nbsp;buffers&amp;nbsp;for&amp;nbsp;decryption&amp;nbsp;*/<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_generic_init</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$key</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$iv</span><span style='color: #007700'>);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$p_t&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mdecrypt_generic</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$c_t</span><span style='color: #007700'>);<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>/*&amp;nbsp;Clean&amp;nbsp;up&amp;nbsp;*/<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_generic_deinit</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_module_close</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(</span><span style='color: #0000BB'>strncmp</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$p_t</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$plain_text</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>strlen</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$plain_text</span><span style='color: #007700'>))&amp;nbsp;==&amp;nbsp;</span><span style='color: #0000BB'>0</span><span style='color: #007700'>)&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #DD0000'>'ok\n'</span><span style='color: #007700'>;<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #DD0000'>'error\n'</span><span style='color: #007700'>;<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> <p class='para'> The above example shows how to check if the data before the encryption is the same as the data after the decryption. It is very important to reinitialize the encryption buffer with <a href='http://www.php.net/manual/en/function.mcrypt-generic-init.php' class='function'>mcrypt_generic_init()</a> before you try to decrypt the data. </p> <p class='para'> The decryption handle should always be initialized with <a href='http://www.php.net/manual/en/function.mcrypt-generic-init.php' class='function'>mcrypt_generic_init()</a> with a key and an IV before calling this function. Where the encryption is done, you should free the encryption buffers by calling <a href='http://www.php.net/manual/en/function.mcrypt-generic-deinit.php' class='function'>mcrypt_generic_deinit()</a>. See <a href='http://www.php.net/manual/en/function.mcrypt-module-open.php' class='function'>mcrypt_module_open()</a> for an example. </p> </div> <a name='function.mdecrypt-generic.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-generic.php' class='function' rel='rdfs-seeAlso'>mcrypt_generic()</a> - This function encrypts data</li> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-generic-init.php' class='function' rel='rdfs-seeAlso'>mcrypt_generic_init()</a> - This function initializes all buffers needed for encryption</li> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-generic-deinit.php' class='function' rel='rdfs-seeAlso'>mcrypt_generic_deinit()</a> - This function deinitializes an encryption module</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_ofb" value="<div id='function.mcrypt-ofb' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-ofb.php'>mcrypt_ofb</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_ofb</span> &amp;mdash; <span class='dc-title'>Encrypt/decrypt data in OFB mode</span></p> </div> <a name='function.mcrypt-ofb.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mcrypt_ofb</b></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$cipher</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$key</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$mode</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$iv</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mcrypt_ofb</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$cipher</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$key</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$mode</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$iv</tt></span> ] )</div> <p class='para rdfs-comment'> The first prototype is when linked against libmcrypt 2.2.x, the second when linked against libmcrypt 2.4.x or higher. The <i><tt class='parameter'>mode</tt></i> should be either <b><tt class='constant'>MCRYPT_ENCRYPT</tt></b> or <b><tt class='constant'>MCRYPT_DECRYPT</tt></b>. </p> <p class='para'> This function should not be used anymore, see <a href='http://www.php.net/manual/en/function.mcrypt-generic.php' class='function'>mcrypt_generic()</a> and <a href='http://www.php.net/manual/en/function.mdecrypt-generic.php' class='function'>mdecrypt_generic()</a> for replacements. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_module_self_test" value="<div id='function.mcrypt-module-self-test' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-module-self-test.php'>mcrypt_module_self_test</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_module_self_test</span> &amp;mdash; <span class='dc-title'>This function runs a self test on the specified module</span></p> </div> <a name='function.mcrypt-module-self-test.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>mcrypt_module_self_test</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$algorithm</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$lib_dir</tt></span> ] )</div> <p class='para rdfs-comment'> This function runs the self test on the algorithm specified. </p> </div> <a name='function.mcrypt-module-self-test.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>algorithm</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The algorithm to test. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>lib_dir</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The optional <i><tt class='parameter'>lib_dir</tt></i> parameter can contain the location of where the algorithm module is on the system. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-module-self-test.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The function returns <b><tt class='constant'>TRUE</tt></b> if the self test succeeds, or <b><tt class='constant'>FALSE</tt></b> when if fails. </p> </div> <a name='function.mcrypt-module-self-test.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>mcrypt_module_self_test()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />var_dump</span><span style='color: #007700'>(</span><span style='color: #0000BB'>mcrypt_module_self_test</span><span style='color: #007700'>(</span><span style='color: #0000BB'>MCRYPT_RIJNDAEL_128</span><span style='color: #007700'>))&amp;nbsp;.&amp;nbsp;</span><span style='color: #DD0000'>'\n'</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>var_dump</span><span style='color: #007700'>(</span><span style='color: #0000BB'>mcrypt_module_self_test</span><span style='color: #007700'>(</span><span style='color: #0000BB'>MCRYPT_BOGUS_CYPHER</span><span style='color: #007700'>));<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> <div class='example-contents para'><p>The above example will output:</p></div> <div class='example-contents screen'> <div class='cdata'><pre> bool(true) bool(false) </pre></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_module_open" value="<div id='function.mcrypt-module-open' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-module-open.php'>mcrypt_module_open</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_module_open</span> &amp;mdash; <span class='dc-title'>Opens the module of the algorithm and the mode to be used</span></p> </div> <a name='function.mcrypt-module-open.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>resource</span> <span class='methodname'><b>mcrypt_module_open</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$algorithm</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$algorithm_directory</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$mode</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$mode_directory</tt></span> )</div> <p class='para rdfs-comment'> This function opens the module of the algorithm and the mode to be used. The name of the algorithm is specified in algorithm, e.g. <i>&amp;quot;twofish&amp;quot;</i> or is one of the <b><tt class='constant'>MCRYPT_ciphername</tt></b> constants. The module is closed by calling <a href='http://www.php.net/manual/en/function.mcrypt-module-close.php' class='function'>mcrypt_module_close()</a>. </p> </div> <a name='function.mcrypt-module-open.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>algorithm</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The algorithm to be used. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>algorithm_directory</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The <i><tt class='parameter'>algorithm_directory</tt></i> and <i><tt class='parameter'>mode_directory</tt></i> are used to locate the encryption modules. When you supply a directory name, it is used. When you set one of these to the empty string (<i>&amp;quot;&amp;quot;</i>), the value set by the <i><tt class='parameter'>mcrypt.algorithms_dir</tt></i> or <i><tt class='parameter'>mcrypt.modes_dir</tt></i> ini-directive is used. When these are not set, the default directories that are used are the ones that were compiled in into libmcrypt (usually <var class='filename'>/usr/local/lib/libmcrypt</var>). </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>mode</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The mode to be used. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>mode_directory</tt></i> </span> </dt><dd class='listitem'> <p class='para'> </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-module-open.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Normally it returns an encryption descriptor, or <b><tt class='constant'>FALSE</tt></b> on error. </p> </div> <a name='function.mcrypt-module-open.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>mcrypt_module_open()</b> examples</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$td&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_module_open</span><span style='color: #007700'>(</span><span style='color: #0000BB'>MCRYPT_DES</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>,<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>MCRYPT_MODE_ECB</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'/usr/lib/mcrypt-modes'</span><span style='color: #007700'>);<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$td&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_module_open</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'rijndael-256'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'ofb'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> <p class='para'> The first line in the example above will try to open the <i>DES</i> cipher from the default directory and the <i>EBC</i> mode from the directory <var class='filename'>/usr/lib/mcrypt-modes</var>. The second example uses strings as name for the cipher and mode, this only works when the extension is linked against libmcrypt 2.4.x or 2.5.x. </p> <p class='para'> </p><div class='example'> <p><b>Example #2 Using <b>mcrypt_module_open()</b> in encryption</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>/*&amp;nbsp;Open&amp;nbsp;the&amp;nbsp;cipher&amp;nbsp;*/<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$td&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_module_open</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'rijndael-256'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'ofb'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>);<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>/*&amp;nbsp;Create&amp;nbsp;the&amp;nbsp;IV&amp;nbsp;and&amp;nbsp;determine&amp;nbsp;the&amp;nbsp;keysize&amp;nbsp;length,&amp;nbsp;use&amp;nbsp;MCRYPT_RAND<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;on&amp;nbsp;Windows&amp;nbsp;instead&amp;nbsp;*/<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$iv&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_create_iv</span><span style='color: #007700'>(</span><span style='color: #0000BB'>mcrypt_enc_get_iv_size</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>),&amp;nbsp;</span><span style='color: #0000BB'>MCRYPT_DEV_RANDOM</span><span style='color: #007700'>);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$ks&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_enc_get_key_size</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>);<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>/*&amp;nbsp;Create&amp;nbsp;key&amp;nbsp;*/<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$key&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>substr</span><span style='color: #007700'>(</span><span style='color: #0000BB'>md5</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'very&amp;nbsp;secret&amp;nbsp;key'</span><span style='color: #007700'>),&amp;nbsp;</span><span style='color: #0000BB'>0</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$ks</span><span style='color: #007700'>);<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>/*&amp;nbsp;Intialize&amp;nbsp;encryption&amp;nbsp;*/<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_generic_init</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$key</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$iv</span><span style='color: #007700'>);<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>/*&amp;nbsp;Encrypt&amp;nbsp;data&amp;nbsp;*/<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$encrypted&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_generic</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'This&amp;nbsp;is&amp;nbsp;very&amp;nbsp;important&amp;nbsp;data'</span><span style='color: #007700'>);<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>/*&amp;nbsp;Terminate&amp;nbsp;encryption&amp;nbsp;handler&amp;nbsp;*/<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_generic_deinit</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>);<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>/*&amp;nbsp;Initialize&amp;nbsp;encryption&amp;nbsp;module&amp;nbsp;for&amp;nbsp;decryption&amp;nbsp;*/<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_generic_init</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$key</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$iv</span><span style='color: #007700'>);<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>/*&amp;nbsp;Decrypt&amp;nbsp;encrypted&amp;nbsp;string&amp;nbsp;*/<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$decrypted&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mdecrypt_generic</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$encrypted</span><span style='color: #007700'>);<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>/*&amp;nbsp;Terminate&amp;nbsp;decryption&amp;nbsp;handle&amp;nbsp;and&amp;nbsp;close&amp;nbsp;module&amp;nbsp;*/<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_generic_deinit</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_module_close</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>);<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #FF8000'>/*&amp;nbsp;Show&amp;nbsp;string&amp;nbsp;*/<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #007700'>echo&amp;nbsp;</span><span style='color: #0000BB'>trim</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$decrypted</span><span style='color: #007700'>)&amp;nbsp;.&amp;nbsp;</span><span style='color: #DD0000'>'\n'</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.mcrypt-module-open.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-module-close.php' class='function' rel='rdfs-seeAlso'>mcrypt_module_close()</a> - Close the mcrypt module</li> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-generic.php' class='function' rel='rdfs-seeAlso'>mcrypt_generic()</a> - This function encrypts data</li> <li class='member'><a href='http://www.php.net/manual/en/function.mdecrypt-generic.php' class='function' rel='rdfs-seeAlso'>mdecrypt_generic()</a> - Decrypt data</li> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-generic-init.php' class='function' rel='rdfs-seeAlso'>mcrypt_generic_init()</a> - This function initializes all buffers needed for encryption</li> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-generic-deinit.php' class='function' rel='rdfs-seeAlso'>mcrypt_generic_deinit()</a> - This function deinitializes an encryption module</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_module_is_block_mode" value="<div id='function.mcrypt-module-is-block-mode' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-module-is-block-mode.php'>mcrypt_module_is_block_mode</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_module_is_block_mode</span> &amp;mdash; <span class='dc-title'>Returns if the specified mode outputs blocks or not</span></p> </div> <a name='function.mcrypt-module-is-block-mode.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>mcrypt_module_is_block_mode</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$mode</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$lib_dir</tt></span> ] )</div> <p class='para rdfs-comment'> This function returns <b><tt class='constant'>TRUE</tt></b> if the mode outputs blocks of bytes or <b><tt class='constant'>FALSE</tt></b> if it outputs just bytes. (e.g. <b><tt class='constant'>TRUE</tt></b> for cbc and ecb, and <b><tt class='constant'>FALSE</tt></b> for cfb and stream). </p> </div> <a name='function.mcrypt-module-is-block-mode.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>mode</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The mode to check. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>lib_dir</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The optional <i><tt class='parameter'>lib_dir</tt></i> parameter can contain the location of where the algorithm module is on the system. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-module-is-block-mode.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> This function returns <b><tt class='constant'>TRUE</tt></b> if the mode outputs blocks of bytes or <b><tt class='constant'>FALSE</tt></b> if it outputs just bytes. (e.g. <b><tt class='constant'>TRUE</tt></b> for cbc and ecb, and <b><tt class='constant'>FALSE</tt></b> for cfb and stream). </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_module_is_block_algorithm_mode" value="<div id='function.mcrypt-module-is-block-algorithm-mode' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-module-is-block-algorithm-mode.php'>mcrypt_module_is_block_algorithm_mode</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_module_is_block_algorithm_mode</span> &amp;mdash; <span class='dc-title'>Returns if the specified module is a block algorithm or not</span></p> </div> <a name='function.mcrypt-module-is-block-algorithm-mode.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>mcrypt_module_is_block_algorithm_mode</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$mode</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$lib_dir</tt></span> ] )</div> <p class='para rdfs-comment'> This function returns <b><tt class='constant'>TRUE</tt></b> if the mode is for use with block algorithms, otherwise it returns <b><tt class='constant'>FALSE</tt></b>. (e.g. <b><tt class='constant'>FALSE</tt></b> for stream, and <b><tt class='constant'>TRUE</tt></b> for cbc, cfb, ofb). </p> </div> <a name='function.mcrypt-module-is-block-algorithm-mode.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>mode</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The mode to check. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>lib_dir</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The optional <i><tt class='parameter'>lib_dir</tt></i> parameter can contain the location of where the algorithm module is on the system. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-module-is-block-algorithm-mode.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> This function returns <b><tt class='constant'>TRUE</tt></b> if the mode is for use with block algorithms, otherwise it returns <b><tt class='constant'>FALSE</tt></b>. (e.g. <b><tt class='constant'>FALSE</tt></b> for stream, and <b><tt class='constant'>TRUE</tt></b> for cbc, cfb, ofb). </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_module_is_block_algorithm" value="<div id='function.mcrypt-module-is-block-algorithm' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-module-is-block-algorithm.php'>mcrypt_module_is_block_algorithm</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_module_is_block_algorithm</span> &amp;mdash; <span class='dc-title'>This function checks whether the specified algorithm is a block algorithm</span></p> </div> <a name='function.mcrypt-module-is-block-algorithm.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>mcrypt_module_is_block_algorithm</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$algorithm</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$lib_dir</tt></span> ] )</div> <p class='para rdfs-comment'> This function returns <b><tt class='constant'>TRUE</tt></b> if the specified algorithm is a block algorithm, or <b><tt class='constant'>FALSE</tt></b> is it is a stream algorithm. </p> </div> <a name='function.mcrypt-module-is-block-algorithm.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>algorithm</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The algorithm to check. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>lib_dir</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The optional <i><tt class='parameter'>lib_dir</tt></i> parameter can contain the location of where the algorithm module is on the system. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-module-is-block-algorithm.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> This function returns <b><tt class='constant'>TRUE</tt></b> if the specified algorithm is a block algorithm, or <b><tt class='constant'>FALSE</tt></b> is it is a stream algorithm. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_module_get_supported_key_sizes" value="<div id='function.mcrypt-module-get-supported-key-sizes' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-module-get-supported-key-sizes.php'>mcrypt_module_get_supported_key_sizes</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_module_get_supported_key_sizes</span> &amp;mdash; <span class='dc-title'>Returns an array with the supported keysizes of the opened algorithm</span></p> </div> <a name='function.mcrypt-module-get-supported-key-sizes.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>array</span> <span class='methodname'><b>mcrypt_module_get_supported_key_sizes</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$algorithm</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$lib_dir</tt></span> ] )</div> <p class='para rdfs-comment'> Returns an array with the key sizes supported by the specified algorithm. If it returns an empty array then all key sizes between 1 and <a href='http://www.php.net/manual/en/function.mcrypt-module-get-algo-key-size.php' class='function'>mcrypt_module_get_algo_key_size()</a> are supported by the algorithm. </p> </div> <a name='function.mcrypt-module-get-supported-key-sizes.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>algorithm</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The algorithm to used. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>lib_dir</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The optional <i><tt class='parameter'>lib_dir</tt></i> parameter can contain the location of where the algorithm module is on the system. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-module-get-supported-key-sizes.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns an array with the key sizes supported by the specified algorithm. If it returns an empty array then all key sizes between 1 and <a href='http://www.php.net/manual/en/function.mcrypt-module-get-algo-key-size.php' class='function'>mcrypt_module_get_algo_key_size()</a> are supported by the algorithm. </p> </div> <a name='function.mcrypt-module-get-supported-key-sizes.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-enc-get-supported-key-sizes.php' class='function' rel='rdfs-seeAlso'>mcrypt_enc_get_supported_key_sizes()</a> - Returns an array with the supported keysizes of the opened algorithm</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_module_get_algo_key_size" value="<div id='function.mcrypt-module-get-algo-key-size' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-module-get-algo-key-size.php'>mcrypt_module_get_algo_key_size</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_module_get_algo_key_size</span> &amp;mdash; <span class='dc-title'>Returns the maximum supported keysize of the opened mode</span></p> </div> <a name='function.mcrypt-module-get-algo-key-size.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>mcrypt_module_get_algo_key_size</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$algorithm</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$lib_dir</tt></span> ] )</div> <p class='para rdfs-comment'> Gets the maximum supported keysize of the opened mode. </p> </div> <a name='function.mcrypt-module-get-algo-key-size.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>algorithm</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The algorithm name. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>lib_dir</tt></i> </span> </dt><dd class='listitem'> <p class='para'> This optional parameter can contain the location where the mode module is on the system. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-module-get-algo-key-size.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> This function returns the maximum supported key size of the algorithm specified in bytes. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_module_get_algo_block_size" value="<div id='function.mcrypt-module-get-algo-block-size' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-module-get-algo-block-size.php'>mcrypt_module_get_algo_block_size</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_module_get_algo_block_size</span> &amp;mdash; <span class='dc-title'>Returns the blocksize of the specified algorithm</span></p> </div> <a name='function.mcrypt-module-get-algo-block-size.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>mcrypt_module_get_algo_block_size</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$algorithm</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$lib_dir</tt></span> ] )</div> <p class='para rdfs-comment'> Gets the blocksize of the specified algorithm. </p> </div> <a name='function.mcrypt-module-get-algo-block-size.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>algorithm</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The algorithm name. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>lib_dir</tt></i> </span> </dt><dd class='listitem'> <p class='para'> This optional parameter can contain the location where the mode module is on the system. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-module-get-algo-block-size.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the block size of the algorithm specified in bytes. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_module_close" value="<div id='function.mcrypt-module-close' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-module-close.php'>mcrypt_module_close</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_module_close</span> &amp;mdash; <span class='dc-title'>Close the mcrypt module</span></p> </div> <a name='function.mcrypt-module-close.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>mcrypt_module_close</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$td</tt></span> )</div> <p class='para rdfs-comment'> Closes the specified encryption handle. </p> </div> <a name='function.mcrypt-module-close.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>td</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The encryption descriptor. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-module-close.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.mcrypt-module-close.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-module-open.php' class='function' rel='rdfs-seeAlso'>mcrypt_module_open()</a> - Opens the module of the algorithm and the mode to be used</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_list_modes" value="<div id='function.mcrypt-list-modes' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-list-modes.php'>mcrypt_list_modes</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_list_modes</span> &amp;mdash; <span class='dc-title'>Get an array of all supported modes</span></p> </div> <a name='function.mcrypt-list-modes.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>array</span> <span class='methodname'><b>mcrypt_list_modes</b></span> ([ <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$lib_dir</tt><span class='initializer'> = ini_get(&amp;quot;mcrypt.algorithms_dir&amp;quot;)</span></span> ] )</div> <p class='para rdfs-comment'> Gets the list of all supported modes in the <i><tt class='parameter'>lib_dir</tt></i> parameter. </p> </div> <a name='function.mcrypt-list-modes.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>lib_dir</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Specifies the directory where all modes are located. If not specifies, the value of the <i>mcrypt.modes_dir</i> <var class='filename'>php.ini</var> directive is used. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-list-modes.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns an array with all the supported modes. </p> </div> <a name='function.mcrypt-list-modes.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>mcrypt_list_modes()</b> Example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$modes&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_list_modes</span><span style='color: #007700'>();<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach&amp;nbsp;(</span><span style='color: #0000BB'>$modes&amp;nbsp;</span><span style='color: #007700'>as&amp;nbsp;</span><span style='color: #0000BB'>$mode</span><span style='color: #007700'>)&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #DD0000'>'</span><span style='color: #0000BB'>$mode</span><span style='color: #DD0000'>&amp;nbsp;&amp;lt;br&amp;nbsp;/&amp;gt;\n'</span><span style='color: #007700'>;<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> <div class='example-contents para'><p> The above example will produce a list with all supported algorithms in the default mode directory. If it is not set with the ini directive mcrypt.modes_dir, the default directory of mcrypt is used (which is <var class='filename'>/usr/local/lib/libmcrypt</var>). </p></div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_list_algorithms" value="<div id='function.mcrypt-list-algorithms' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-list-algorithms.php'>mcrypt_list_algorithms</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_list_algorithms</span> &amp;mdash; <span class='dc-title'>Get an array of all supported ciphers</span></p> </div> <a name='function.mcrypt-list-algorithms.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>array</span> <span class='methodname'><b>mcrypt_list_algorithms</b></span> ([ <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$lib_dir</tt><span class='initializer'> = ini_get(&amp;quot;mcrypt.algorithms_dir&amp;quot;)</span></span> ] )</div> <p class='para rdfs-comment'> Gets the list of all supported algorithms in the <i><tt class='parameter'>lib_dir</tt></i> parameter. </p> </div> <a name='function.mcrypt-list-algorithms.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>lib_dir</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Specifies the directory where all algorithms are located. If not specifies, the value of the mcrypt.algorithms_dir <var class='filename'>php.ini</var> directive is used. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-list-algorithms.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns an array with all the supported algorithms. </p> </div> <a name='function.mcrypt-list-algorithms.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>mcrypt_list_algorithms()</b> Example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$algorithms&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_list_algorithms</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'/usr/local/lib/libmcrypt'</span><span style='color: #007700'>);<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach&amp;nbsp;(</span><span style='color: #0000BB'>$algorithms&amp;nbsp;</span><span style='color: #007700'>as&amp;nbsp;</span><span style='color: #0000BB'>$cipher</span><span style='color: #007700'>)&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #DD0000'>'</span><span style='color: #0000BB'>$cipher</span><span style='color: #DD0000'>&amp;lt;br&amp;nbsp;/&amp;gt;\n'</span><span style='color: #007700'>;<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> <div class='example-contents para'><p> The above example will produce a list with all supported algorithms in the &amp;quot;<var class='filename'>/usr/local/lib/libmcrypt</var>&amp;quot; directory. </p></div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_get_key_size" value="<div id='function.mcrypt-get-key-size' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-get-key-size.php'>mcrypt_get_key_size</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_get_key_size</span> &amp;mdash; <span class='dc-title'>Get the key size of the specified cipher</span></p> </div> <a name='function.mcrypt-get-key-size.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>mcrypt_get_key_size</b></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$cipher</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>mcrypt_get_key_size</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$cipher</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$module</tt></span> )</div> <p class='para rdfs-comment'> The first prototype is when linked against libmcrypt 2.2.x, the second when linked against libmcrypt 2.4.x or 2.5.x. </p> <p class='para'> <b>mcrypt_get_key_size()</b> is used to get the size of a key of the specified <i><tt class='parameter'>cipher</tt></i> (in combination with an encryption mode). </p> <p class='para'> This example shows how to use this function when linked against libmcrypt 2.4.x and 2.5.x. It is more useful to use the <a href='http://www.php.net/manual/en/function.mcrypt-enc-get-key-size.php' class='function'>mcrypt_enc_get_key_size()</a> function as this uses the resource returned by <a href='http://www.php.net/manual/en/function.mcrypt-module-open.php' class='function'>mcrypt_module_open()</a>. </p><div class='example'> <p><b>Example #1 <b>mcrypt_get_key_size()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #007700'>echo&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_get_key_size</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'tripledes'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'ecb'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;<br /></span><br />Prints:<br />24</span> </code></div> </div> </div><p> </p> <p class='para'> See also: <a href='http://www.php.net/manual/en/function.mcrypt-get-block-size.php' class='function'>mcrypt_get_block_size()</a>, <a href='http://www.php.net/manual/en/function.mcrypt-enc-get-key-size.php' class='function'>mcrypt_enc_get_key_size()</a> and <a href='http://www.php.net/manual/en/function.mcrypt-encrypt.php' class='function'>mcrypt_encrypt()</a>. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_get_iv_size" value="<div id='function.mcrypt-get-iv-size' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-get-iv-size.php'>mcrypt_get_iv_size</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_get_iv_size</span> &amp;mdash; <span class='dc-title'>Returns the size of the IV belonging to a specific cipher/mode combination</span></p> </div> <a name='function.mcrypt-get-iv-size.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>mcrypt_get_iv_size</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$cipher</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$mode</tt></span> )</div> <p class='para rdfs-comment'> Gets the size of the IV belonging to a specific <i><tt class='parameter'>cipher</tt></i> /<i><tt class='parameter'>mode</tt></i> combination. </p> <p class='para'> It is more useful to use the <a href='http://www.php.net/manual/en/function.mcrypt-enc-get-iv-size.php' class='function'>mcrypt_enc_get_iv_size()</a> function as this uses the resource returned by <a href='http://www.php.net/manual/en/function.mcrypt-module-open.php' class='function'>mcrypt_module_open()</a>. </p> </div> <a name='function.mcrypt-get-iv-size.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>cipher</tt></i> </span> </dt><dd class='listitem'> <p class='para'> One of the <i>MCRYPT_ciphername</i> constants of the name of the algorithm as string. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>mode</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>mode</tt></i> is one of the MCRYPT_MODE_modename constants or one of &amp;quot;ecb&amp;quot;, &amp;quot;cbc&amp;quot;, &amp;quot;cfb&amp;quot;, &amp;quot;ofb&amp;quot;, &amp;quot;nofb&amp;quot; or &amp;quot;stream&amp;quot;. The IV is ignored in ECB mode as this mode does not require it. You will need to have the same IV (think: starting point) both at encryption and decryption stages, otherwise your encryption will fail. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-get-iv-size.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the size of the Initialisation Vector (IV) in bytes. On error the function returns <b><tt class='constant'>FALSE</tt></b>. If the IV is ignored in the specified cipher/mode combination zero is returned. </p> </div> <a name='function.mcrypt-get-iv-size.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>mcrypt_get_iv_size()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #007700'>echo&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_get_iv_size</span><span style='color: #007700'>(</span><span style='color: #0000BB'>MCRYPT_CAST_256</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>MCRYPT_MODE_CFB</span><span style='color: #007700'>)&amp;nbsp;.&amp;nbsp;</span><span style='color: #DD0000'>'\n'</span><span style='color: #007700'>;<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_get_iv_size</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'des'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'ecb'</span><span style='color: #007700'>)&amp;nbsp;.&amp;nbsp;</span><span style='color: #DD0000'>'\n'</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.mcrypt-get-iv-size.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-get-block-size.php' class='function' rel='rdfs-seeAlso'>mcrypt_get_block_size()</a> - Get the block size of the specified cipher</li> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-enc-get-iv-size.php' class='function' rel='rdfs-seeAlso'>mcrypt_enc_get_iv_size()</a> - Returns the size of the IV of the opened algorithm</li> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-create-iv.php' class='function' rel='rdfs-seeAlso'>mcrypt_create_iv()</a> - Create an initialization vector (IV) from a random source</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_get_cipher_name" value="<div id='function.mcrypt-get-cipher-name' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-get-cipher-name.php'>mcrypt_get_cipher_name</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_get_cipher_name</span> &amp;mdash; <span class='dc-title'>Get the name of the specified cipher</span></p> </div> <a name='function.mcrypt-get-cipher-name.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mcrypt_get_cipher_name</b></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$cipher</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mcrypt_get_cipher_name</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$cipher</tt></span> )</div> <p class='para rdfs-comment'> <b>mcrypt_get_cipher_name()</b> is used to get the name of the specified cipher. </p> <p class='para'> <b>mcrypt_get_cipher_name()</b> takes the cipher number as an argument (libmcrypt 2.2.x) or takes the cipher name as an argument (libmcrypt 2.4.x or higher) and returns the name of the cipher or <b><tt class='constant'>FALSE</tt></b>, if the cipher does not exist. </p> </div> <a name='function.mcrypt-get-cipher-name.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>cipher</tt></i> </span> </dt><dd class='listitem'> <p class='para'> One of the <i>MCRYPT_ciphername</i> constants or the name of the algorithm as string. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-get-cipher-name.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> This function returns the name of the cipher or <b><tt class='constant'>FALSE</tt></b>, if the cipher does not exist. </p> </div> <a name='function.mcrypt-get-cipher-name.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>mcrypt_get_cipher_name()</b> Example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;$cipher&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>MCRYPT_TripleDES</span><span style='color: #007700'>;<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_get_cipher_name</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$cipher</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> <div class='example-contents para'><p>The above example will output:</p></div> <div class='example-contents screen'> <div class='cdata'><pre> 3DES </pre></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_get_block_size" value="<div id='function.mcrypt-get-block-size' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-get-block-size.php'>mcrypt_get_block_size</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_get_block_size</span> &amp;mdash; <span class='dc-title'>Get the block size of the specified cipher</span></p> </div> <a name='function.mcrypt-get-block-size.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>mcrypt_get_block_size</b></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$cipher</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>mcrypt_get_block_size</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$cipher</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$module</tt></span> )</div> <p class='para rdfs-comment'> The first prototype is when linked against libmcrypt 2.2.x, the second when linked against libmcrypt 2.4.x or 2.5.x. </p> <p class='para'> <b>mcrypt_get_block_size()</b> is used to get the size of a block of the specified <i><tt class='parameter'>cipher</tt></i> (in combination with an encryption mode). </p> <p class='para'> It is more useful to use the <a href='http://www.php.net/manual/en/function.mcrypt-enc-get-block-size.php' class='function'>mcrypt_enc_get_block_size()</a> function as this uses the resource returned by <a href='http://www.php.net/manual/en/function.mcrypt-module-open.php' class='function'>mcrypt_module_open()</a>. </p> </div> <a name='function.mcrypt-get-block-size.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>cipher</tt></i> </span> </dt><dd class='listitem'> <p class='para'> One of the <i>MCRYPT_ciphername</i> constants or the name of the algorithm as string. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>module</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The module. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-get-block-size.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Gets the block size, as an integer. </p> </div> <a name='function.mcrypt-get-block-size.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>mcrypt_get_block_size()</b> example</b></p> <div class='example-contents para'><p> This example shows how to use this function when linked against libmcrypt 2.4.x and 2.5.x. </p></div> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /><br /></span><span style='color: #007700'>echo&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_get_block_size</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'tripledes'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'ecb'</span><span style='color: #007700'>);&amp;nbsp;</span><span style='color: #FF8000'>//&amp;nbsp;8<br /><br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.mcrypt-get-block-size.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-get-key-size.php' class='function' rel='rdfs-seeAlso'>mcrypt_get_key_size()</a> - Get the key size of the specified cipher</li> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-enc-get-block-size.php' class='function' rel='rdfs-seeAlso'>mcrypt_enc_get_block_size()</a> - Returns the blocksize of the opened algorithm</li> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-encrypt.php' class='function' rel='rdfs-seeAlso'>mcrypt_encrypt()</a> - Encrypts plaintext with given parameters</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_generic_init" value="<div id='function.mcrypt-generic-init' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-generic-init.php'>mcrypt_generic_init</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_generic_init</span> &amp;mdash; <span class='dc-title'>This function initializes all buffers needed for encryption</span></p> </div> <a name='function.mcrypt-generic-init.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>mcrypt_generic_init</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$td</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$key</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$iv</tt></span> )</div> <p class='para rdfs-comment'> You need to call this function before every call to <a href='http://www.php.net/manual/en/function.mcrypt-generic.php' class='function'>mcrypt_generic()</a> or <a href='http://www.php.net/manual/en/function.mdecrypt-generic.php' class='function'>mdecrypt_generic()</a>. </p> </div> <a name='function.mcrypt-generic-init.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>td</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The encryption descriptor. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The maximum length of the key should be the one obtained by calling <a href='http://www.php.net/manual/en/function.mcrypt-enc-get-key-size.php' class='function'>mcrypt_enc_get_key_size()</a> and every value smaller than this is legal. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>iv</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The IV should normally have the size of the algorithms block size, but you must obtain the size by calling <a href='http://www.php.net/manual/en/function.mcrypt-enc-get-iv-size.php' class='function'>mcrypt_enc_get_iv_size()</a>. IV is ignored in ECB. IV MUST exist in CFB, CBC, STREAM, nOFB and OFB modes. It needs to be random and unique (but not secret). The same IV must be used for encryption/decryption. If you do not want to use it you should set it to zeros, but this is not recommended. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-generic-init.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The function returns a negative value on error, -3 when the key length was incorrect, -4 when there was a memory allocation problem and any other return value is an unknown error. If an error occurs a warning will be displayed accordingly. <b><tt class='constant'>FALSE</tt></b> is returned if incorrect parameters were passed. </p> </div> <a name='function.mcrypt-generic-init.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-module-open.php' class='function' rel='rdfs-seeAlso'>mcrypt_module_open()</a> - Opens the module of the algorithm and the mode to be used</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_generic_end" value="<div id='function.mcrypt-generic-end' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-generic-end.php'>mcrypt_generic_end</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5 &amp;lt;= 5.1.6)</p><p class='refpurpose'><span class='refname'>mcrypt_generic_end</span> &amp;mdash; <span class='dc-title'>This function terminates encryption</span></p> </div> <a name='function.mcrypt-generic-end.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>mcrypt_generic_end</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$td</tt></span> )</div> <p class='para rdfs-comment'> <div class='warning'><b class='warning'>Warning</b> <p class='para'> This function is deprecated, use <a href='http://www.php.net/manual/en/function.mcrypt-generic-deinit.php' class='function'>mcrypt_generic_deinit()</a> instead. It can cause crashes when used with <a href='http://www.php.net/manual/en/function.mcrypt-module-close.php' class='function'>mcrypt_module_close()</a> due to multiple buffer frees. </p> </div> </p> <p class='para'> This function terminates encryption specified by the encryption descriptor (<i><tt class='parameter'>td</tt></i> ). Actually it clears all buffers, and closes all the modules used. Returns <b><tt class='constant'>FALSE</tt></b> on error, or <b><tt class='constant'>TRUE</tt></b> on success. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_generic_deinit" value="<div id='function.mcrypt-generic-deinit' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-generic-deinit.php'>mcrypt_generic_deinit</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.7, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_generic_deinit</span> &amp;mdash; <span class='dc-title'>This function deinitializes an encryption module</span></p> </div> <a name='function.mcrypt-generic-deinit.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>mcrypt_generic_deinit</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$td</tt></span> )</div> <p class='para rdfs-comment'> This function terminates encryption specified by the encryption descriptor (<i><tt class='parameter'>td</tt></i> ). It clears all buffers, but does not close the module. You need to call <a href='http://www.php.net/manual/en/function.mcrypt-module-close.php' class='function'>mcrypt_module_close()</a> yourself. (But PHP does this for you at the end of the script.) </p> </div> <a name='function.mcrypt-generic-deinit.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>td</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The encryption descriptor. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-generic-deinit.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.mcrypt-generic-deinit.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-module-open.php' class='function' rel='rdfs-seeAlso'>mcrypt_module_open()</a> - Opens the module of the algorithm and the mode to be used</li> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-generic-init.php' class='function' rel='rdfs-seeAlso'>mcrypt_generic_init()</a> - This function initializes all buffers needed for encryption</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_generic" value="<div id='function.mcrypt-generic' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-generic.php'>mcrypt_generic</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_generic</span> &amp;mdash; <span class='dc-title'>This function encrypts data</span></p> </div> <a name='function.mcrypt-generic.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mcrypt_generic</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$td</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> )</div> <p class='para rdfs-comment'> This function encrypts data. The data is padded with &amp;quot;<i>\0</i>&amp;quot; to make sure the length of the data is n * blocksize. This function returns the encrypted data. Note that the length of the returned string can in fact be longer then the input, due to the padding of the data. </p> <p class='para'> If you want to store the encrypted data in a database make sure to store the entire string as returned by mcrypt_generic, or the string will not entirely decrypt properly. If your original string is 10 characters long and the block size is 8 (use <a href='http://www.php.net/manual/en/function.mcrypt-enc-get-block-size.php' class='function'>mcrypt_enc_get_block_size()</a> to determine the blocksize), you would need at least 16 characters in your database field. Note the string returned by <a href='http://www.php.net/manual/en/function.mdecrypt-generic.php' class='function'>mdecrypt_generic()</a> will be 16 characters as well...use rtrim($str, &amp;quot;\0&amp;quot;) to remove the padding. </p> <p class='para'> If you are for example storing the data in a MySQL database remember that varchar fields automatically have trailing spaces removed during insertion. As encrypted data can end in a space (ASCII 32), the data will be damaged by this removal. Store data in a tinyblob/tinytext (or larger) field instead. </p> </div> <a name='function.mcrypt-generic.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>td</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The encryption descriptor. </p> <p class='para'> The encryption handle should always be initialized with <a href='http://www.php.net/manual/en/function.mcrypt-generic-init.php' class='function'>mcrypt_generic_init()</a> with a key and an IV before calling this function. Where the encryption is done, you should free the encryption buffers by calling <a href='http://www.php.net/manual/en/function.mcrypt-generic-deinit.php' class='function'>mcrypt_generic_deinit()</a>. See <a href='http://www.php.net/manual/en/function.mcrypt-module-open.php' class='function'>mcrypt_module_open()</a> for an example. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The data to encrypt. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-generic.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the encrypted data. </p> </div> <a name='function.mcrypt-generic.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.mdecrypt-generic.php' class='function' rel='rdfs-seeAlso'>mdecrypt_generic()</a> - Decrypt data</li> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-generic-init.php' class='function' rel='rdfs-seeAlso'>mcrypt_generic_init()</a> - This function initializes all buffers needed for encryption</li> <li class='member'><a href='http://www.php.net/manual/en/function.mcrypt-generic-deinit.php' class='function' rel='rdfs-seeAlso'>mcrypt_generic_deinit()</a> - This function deinitializes an encryption module</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_encrypt" value="<div id='function.mcrypt-encrypt' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-encrypt.php'>mcrypt_encrypt</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_encrypt</span> &amp;mdash; <span class='dc-title'>Encrypts plaintext with given parameters</span></p> </div> <a name='function.mcrypt-encrypt.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mcrypt_encrypt</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$cipher</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$key</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$mode</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$iv</tt></span> ] )</div> <p class='para rdfs-comment'> Encrypts the data and returns it. </p> </div> <a name='function.mcrypt-encrypt.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>cipher</tt></i> </span> </dt><dd class='listitem'> <p class='para'> One of the <i>MCRYPT_ciphername</i> constants of the name of the algorithm as string. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The key with which the data will be encrypted. If it&amp;#039;s smaller that the required keysize, it is padded with &amp;#039;<i>\0</i>&amp;#039;. It is better not to use ASCII strings for keys. </p> <p class='para'> It is recommended to use the mhash functions to create a key from a string. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The data that will be encrypted with the given cipher and mode. If the size of the data is not n * blocksize, the data will be padded with &amp;#039;<i>\0</i>&amp;#039;. </p> <p class='para'> The returned crypttext can be larger that the size of the data that is given by <i><tt class='parameter'>data</tt></i> . </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>mode</tt></i> </span> </dt><dd class='listitem'> <p class='para'> One of the <i>MCRYPT_MODE_modename</i> constants of one of &amp;quot;ecb&amp;quot;, &amp;quot;cbc&amp;quot;, &amp;quot;cfb&amp;quot;, &amp;quot;ofb&amp;quot;, &amp;quot;nofb&amp;quot; or &amp;quot;stream&amp;quot;. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>iv</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Used for the initialisation in CBC, CFB, OFB modes, and in some algorithms in STREAM mode. If you do not supply an IV, while it is needed for an algorithm, the function issues a warning and uses an IV with all bytes set to &amp;#039;<i>\0</i>&amp;#039;. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-encrypt.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the encrypted data, as a string. </p> </div> <a name='function.mcrypt-encrypt.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>mcrypt_encrypt()</b> Example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$iv_size&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_get_iv_size</span><span style='color: #007700'>(</span><span style='color: #0000BB'>MCRYPT_RIJNDAEL_256</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>MCRYPT_MODE_ECB</span><span style='color: #007700'>);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$iv&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_create_iv</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$iv_size</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>MCRYPT_RAND</span><span style='color: #007700'>);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$key&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #DD0000'>'This&amp;nbsp;is&amp;nbsp;a&amp;nbsp;very&amp;nbsp;secret&amp;nbsp;key'</span><span style='color: #007700'>;<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$text&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #DD0000'>'Meet&amp;nbsp;me&amp;nbsp;at&amp;nbsp;11&amp;nbsp;o'clock&amp;nbsp;behind&amp;nbsp;the&amp;nbsp;monument.'</span><span style='color: #007700'>;<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #0000BB'>strlen</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$text</span><span style='color: #007700'>)&amp;nbsp;.&amp;nbsp;</span><span style='color: #DD0000'>'\n'</span><span style='color: #007700'>;<br /><br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$crypttext&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_encrypt</span><span style='color: #007700'>(</span><span style='color: #0000BB'>MCRYPT_RIJNDAEL_256</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$key</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$text</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>MCRYPT_MODE_ECB</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$iv</span><span style='color: #007700'>);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #0000BB'>strlen</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$crypttext</span><span style='color: #007700'>)&amp;nbsp;.&amp;nbsp;</span><span style='color: #DD0000'>'\n'</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> <div class='example-contents para'><p>The above example will output:</p></div> <div class='example-contents screen'> <div class='cdata'><pre> 42 64 </pre></div> </div> </div><p> </p> <p class='para'> See also <a href='http://www.php.net/manual/en/function.mcrypt-module-open.php' class='function'>mcrypt_module_open()</a> for a more advanced API and an example. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_enc_self_test" value="<div id='function.mcrypt-enc-self-test' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-enc-self-test.php'>mcrypt_enc_self_test</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_enc_self_test</span> &amp;mdash; <span class='dc-title'>Runs a self test on the opened module</span></p> </div> <a name='function.mcrypt-enc-self-test.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>mcrypt_enc_self_test</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$td</tt></span> )</div> <p class='para rdfs-comment'> This function runs the self test on the algorithm specified by the descriptor <i><tt class='parameter'>td</tt></i> . </p> </div> <a name='function.mcrypt-enc-self-test.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>td</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The encryption descriptor. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-enc-self-test.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> If the self test succeeds it returns <b><tt class='constant'>FALSE</tt></b>. In case of an error, it returns <b><tt class='constant'>TRUE</tt></b>. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_enc_is_block_mode" value="<div id='function.mcrypt-enc-is-block-mode' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-enc-is-block-mode.php'>mcrypt_enc_is_block_mode</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_enc_is_block_mode</span> &amp;mdash; <span class='dc-title'>Checks whether the opened mode outputs blocks</span></p> </div> <a name='function.mcrypt-enc-is-block-mode.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>mcrypt_enc_is_block_mode</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$td</tt></span> )</div> <p class='para rdfs-comment'> Tells whether the opened mode outputs blocks (e.g. <b><tt class='constant'>TRUE</tt></b> for cbc and ecb, and <b><tt class='constant'>FALSE</tt></b> for cfb and stream). </p> </div> <a name='function.mcrypt-enc-is-block-mode.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>td</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The encryption descriptor. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-enc-is-block-mode.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> if the mode outputs blocks of bytes or <b><tt class='constant'>FALSE</tt></b> if it outputs bytes. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_enc_is_block_algorithm_mode" value="<div id='function.mcrypt-enc-is-block-algorithm-mode' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-enc-is-block-algorithm-mode.php'>mcrypt_enc_is_block_algorithm_mode</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_enc_is_block_algorithm_mode</span> &amp;mdash; <span class='dc-title'>Checks whether the encryption of the opened mode works on blocks</span></p> </div> <a name='function.mcrypt-enc-is-block-algorithm-mode.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>mcrypt_enc_is_block_algorithm_mode</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$td</tt></span> )</div> <p class='para rdfs-comment'> Tells whether the algorithm of the opened mode works on blocks (e.g. <b><tt class='constant'>FALSE</tt></b> for stream, and <b><tt class='constant'>TRUE</tt></b> for cbc, cfb, ofb).. </p> </div> <a name='function.mcrypt-enc-is-block-algorithm-mode.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>td</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The encryption descriptor. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-enc-is-block-algorithm-mode.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> if the mode is for use with block algorithms, otherwise it returns <b><tt class='constant'>FALSE</tt></b>. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_enc_is_block_algorithm" value="<div id='function.mcrypt-enc-is-block-algorithm' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-enc-is-block-algorithm.php'>mcrypt_enc_is_block_algorithm</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_enc_is_block_algorithm</span> &amp;mdash; <span class='dc-title'>Checks whether the algorithm of the opened mode is a block algorithm</span></p> </div> <a name='function.mcrypt-enc-is-block-algorithm.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>mcrypt_enc_is_block_algorithm</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$td</tt></span> )</div> <p class='para rdfs-comment'> Tells whether the algorithm of the opened mode is a block algorithm. </p> </div> <a name='function.mcrypt-enc-is-block-algorithm.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>td</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The encryption descriptor. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-enc-is-block-algorithm.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> if the algorithm is a block algorithm or <b><tt class='constant'>FALSE</tt></b> if it is a stream one. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_enc_get_supported_key_sizes" value="<div id='function.mcrypt-enc-get-supported-key-sizes' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-enc-get-supported-key-sizes.php'>mcrypt_enc_get_supported_key_sizes</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_enc_get_supported_key_sizes</span> &amp;mdash; <span class='dc-title'>Returns an array with the supported keysizes of the opened algorithm</span></p> </div> <a name='function.mcrypt-enc-get-supported-key-sizes.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>array</span> <span class='methodname'><b>mcrypt_enc_get_supported_key_sizes</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$td</tt></span> )</div> <p class='para rdfs-comment'> Gets the supported key sizes of the opened algorithm. </p> </div> <a name='function.mcrypt-enc-get-supported-key-sizes.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>td</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The encryption descriptor. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-enc-get-supported-key-sizes.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns an array with the key sizes supported by the algorithm specified by the encryption descriptor. If it returns an empty array then all key sizes between 1 and <a href='http://www.php.net/manual/en/function.mcrypt-enc-get-key-size.php' class='function'>mcrypt_enc_get_key_size()</a> are supported by the algorithm. </p> </div> <a name='function.mcrypt-enc-get-supported-key-sizes.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>mcrypt_enc_get_supported_key_sizes()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$td&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_module_open</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'rijndael-256'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'ecb'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>var_dump</span><span style='color: #007700'>(</span><span style='color: #0000BB'>mcrypt_enc_get_supported_key_sizes</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>));<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> <div class='example-contents para'><p> This will print: </p></div> <div class='example-contents screen'> <div class='cdata'><pre> array(3) { [0]=&amp;gt; int(16) [1]=&amp;gt; int(24) [2]=&amp;gt; int(32) } </pre></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_enc_get_modes_name" value="<div id='function.mcrypt-enc-get-modes-name' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-enc-get-modes-name.php'>mcrypt_enc_get_modes_name</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_enc_get_modes_name</span> &amp;mdash; <span class='dc-title'>Returns the name of the opened mode</span></p> </div> <a name='function.mcrypt-enc-get-modes-name.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mcrypt_enc_get_modes_name</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$td</tt></span> )</div> <p class='para rdfs-comment'> This function returns the name of the mode. </p> </div> <a name='function.mcrypt-enc-get-modes-name.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>td</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The encryption descriptor. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-enc-get-modes-name.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the name as a string. </p> </div> <a name='function.mcrypt-enc-get-modes-name.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>mcrypt_enc_get_modes_name()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$td&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_module_open&amp;nbsp;</span><span style='color: #007700'>(</span><span style='color: #0000BB'>MCRYPT_CAST_256</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>MCRYPT_MODE_CFB</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>);<br />echo&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_enc_get_modes_name</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>).&amp;nbsp;</span><span style='color: #DD0000'>'\n'</span><span style='color: #007700'>;<br /><br /></span><span style='color: #0000BB'>$td&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_module_open&amp;nbsp;</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'cast-256'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'ecb'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>);<br />echo&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_enc_get_modes_name</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>).&amp;nbsp;</span><span style='color: #DD0000'>'\n'</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> <div class='example-contents para'><p>The above example will output:</p></div> <div class='example-contents screen'> <div class='cdata'><pre> CFB ECB </pre></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_enc_get_key_size" value="<div id='function.mcrypt-enc-get-key-size' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-enc-get-key-size.php'>mcrypt_enc_get_key_size</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_enc_get_key_size</span> &amp;mdash; <span class='dc-title'>Returns the maximum supported keysize of the opened mode</span></p> </div> <a name='function.mcrypt-enc-get-key-size.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>mcrypt_enc_get_key_size</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$td</tt></span> )</div> <p class='para rdfs-comment'> Gets the maximum supported key size of the algorithm in bytes. </p> </div> <a name='function.mcrypt-enc-get-key-size.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>td</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The encryption descriptor. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-enc-get-key-size.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the maximum supported key size of the algorithm in bytes. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_enc_get_iv_size" value="<div id='function.mcrypt-enc-get-iv-size' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-enc-get-iv-size.php'>mcrypt_enc_get_iv_size</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_enc_get_iv_size</span> &amp;mdash; <span class='dc-title'>Returns the size of the IV of the opened algorithm</span></p> </div> <a name='function.mcrypt-enc-get-iv-size.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>mcrypt_enc_get_iv_size</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$td</tt></span> )</div> <p class='para rdfs-comment'> This function returns the size of the IV of the algorithm specified by the encryption descriptor in bytes. An IV is used in cbc, cfb and ofb modes, and in some algorithms in stream mode. </p> </div> <a name='function.mcrypt-enc-get-iv-size.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>td</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The encryption descriptor. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-enc-get-iv-size.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the size of the IV, or 0 if the IV is ignored in the algorithm. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_enc_get_block_size" value="<div id='function.mcrypt-enc-get-block-size' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-enc-get-block-size.php'>mcrypt_enc_get_block_size</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_enc_get_block_size</span> &amp;mdash; <span class='dc-title'>Returns the blocksize of the opened algorithm</span></p> </div> <a name='function.mcrypt-enc-get-block-size.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>mcrypt_enc_get_block_size</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$td</tt></span> )</div> <p class='para rdfs-comment'> Gets the blocksize of the opened algorithm. </p> </div> <a name='function.mcrypt-enc-get-block-size.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>td</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The encryption descriptor. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-enc-get-block-size.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the block size of the specified algorithm in bytes. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_enc_get_algorithms_name" value="<div id='function.mcrypt-enc-get-algorithms-name' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-enc-get-algorithms-name.php'>mcrypt_enc_get_algorithms_name</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_enc_get_algorithms_name</span> &amp;mdash; <span class='dc-title'>Returns the name of the opened algorithm</span></p> </div> <a name='function.mcrypt-enc-get-algorithms-name.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mcrypt_enc_get_algorithms_name</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$td</tt></span> )</div> <p class='para rdfs-comment'> This function returns the name of the algorithm. </p> </div> <a name='function.mcrypt-enc-get-algorithms-name.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>td</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The encryption descriptor. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-enc-get-algorithms-name.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the name of the opened algorithm as a string. </p> </div> <a name='function.mcrypt-enc-get-algorithms-name.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>mcrypt_enc_get_algorithms_name()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$td&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_module_open</span><span style='color: #007700'>(</span><span style='color: #0000BB'>MCRYPT_CAST_256</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>MCRYPT_MODE_CFB</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>);<br />echo&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_enc_get_algorithms_name</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>).&amp;nbsp;</span><span style='color: #DD0000'>'\n'</span><span style='color: #007700'>;<br /><br /></span><span style='color: #0000BB'>$td&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_module_open</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'cast-256'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>MCRYPT_MODE_CFB</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>);<br />echo&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_enc_get_algorithms_name</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$td</span><span style='color: #007700'>).&amp;nbsp;</span><span style='color: #DD0000'>'\n'</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> <div class='example-contents para'><p>The above example will output:</p></div> <div class='example-contents screen'> <div class='cdata'><pre> CAST-256 CAST-256 </pre></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_ecb" value="<div id='function.mcrypt-ecb' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-ecb.php'>mcrypt_ecb</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_ecb</span> &amp;mdash; <span class='dc-title'>Deprecated: Encrypt/decrypt data in ECB mode</span></p> </div> <a name='function.mcrypt-ecb.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mcrypt_ecb</b></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$cipher</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$key</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$mode</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mcrypt_ecb</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$cipher</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$key</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$mode</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$iv</tt></span> ] )</div> <p class='para rdfs-comment'> The first prototype is when linked against libmcrypt 2.2.x, the second when linked against libmcrypt 2.4.x or higher. The <i><tt class='parameter'>mode</tt></i> should be either <b><tt class='constant'>MCRYPT_ENCRYPT</tt></b> or <b><tt class='constant'>MCRYPT_DECRYPT</tt></b>. </p> <p class='para'> This function is deprecated and should not be used anymore, see <a href='http://www.php.net/manual/en/function.mcrypt-generic.php' class='function'>mcrypt_generic()</a> and <a href='http://www.php.net/manual/en/function.mdecrypt-generic.php' class='function'>mdecrypt_generic()</a> for replacements. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_decrypt" value="<div id='function.mcrypt-decrypt' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-decrypt.php'>mcrypt_decrypt</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.2, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_decrypt</span> &amp;mdash; <span class='dc-title'>Decrypts crypttext with given parameters</span></p> </div> <a name='function.mcrypt-decrypt.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mcrypt_decrypt</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$cipher</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$key</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$mode</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$iv</tt></span> ] )</div> <p class='para rdfs-comment'> Decrypts the <i><tt class='parameter'>data</tt></i> and returns the unencrypted data. </p> </div> <a name='function.mcrypt-decrypt.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>cipher</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>cipher</tt></i> is one of the MCRYPT_ciphername constants of the name of the algorithm as string. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>key</tt></i> is the key with which the data is encrypted. If it&amp;#039;s smaller that the required keysize, it is padded with &amp;#039;<i>\0</i>&amp;#039;. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>data</tt></i> is the data that will be decrypted with the given cipher and mode. If the size of the data is not n * blocksize, the data will be padded with &amp;#039;<i>\0</i>&amp;#039;. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>mode</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>mode</tt></i> is one of the MCRYPT_MODE_modename constants of one of &amp;quot;ecb&amp;quot;, &amp;quot;cbc&amp;quot;, &amp;quot;cfb&amp;quot;, &amp;quot;ofb&amp;quot;, &amp;quot;nofb&amp;quot; or &amp;quot;stream&amp;quot;. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>iv</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The <i><tt class='parameter'>iv</tt></i> parameter is used for the initialisation in CBC, CFB, OFB modes, and in some algorithms in STREAM mode. If you do not supply an IV, while it is needed for an algorithm, the function issues a warning and uses an IV with all bytes set to &amp;#039;<i>\0</i>&amp;#039;. </p> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-decrypt.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the decrypted data as a string. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_create_iv" value="<div id='function.mcrypt-create-iv' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-create-iv.php'>mcrypt_create_iv</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_create_iv</span> &amp;mdash; <span class='dc-title'>Create an initialization vector (IV) from a random source</span></p> </div> <a name='function.mcrypt-create-iv.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mcrypt_create_iv</b></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$size</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$source</tt><span class='initializer'> = MCRYPT_DEV_RANDOM</span></span> ] )</div> <p class='para rdfs-comment'> Create an initialization vector (IV) from a random source. </p> <p class='para'> The IV is only meant to give an alternative seed to the encryption routines. This IV does not need to be secret at all, though it can be desirable. You even can send it along with your ciphertext without losing security. </p> </div> <a name='function.mcrypt-create-iv.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>size</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Determines the size of the IV, parameter <i><tt class='parameter'>source</tt></i> (defaults to random value) specifies the source of the IV. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>source</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The source can be <b><tt class='constant'>MCRYPT_RAND</tt></b> (system random number generator), <b><tt class='constant'>MCRYPT_DEV_RANDOM</tt></b> (read data from <var class='filename'>/dev/random</var>) and <b><tt class='constant'>MCRYPT_DEV_URANDOM</tt></b> (read data from <var class='filename'>/dev/urandom</var>). <b><tt class='constant'>MCRYPT_RAND</tt></b> is the only one supported on Windows because Windows (of course) doesn&amp;#039;t have <var class='filename'>/dev/random</var> or <var class='filename'>/dev/urandom</var>. </p> <blockquote><p><b class='note'>Note</b>: When using <b><tt class='constant'>MCRYPT_RAND</tt></b>, remember to call <a href='http://www.php.net/manual/en/function.srand.php' class='function'>srand()</a> before <b>mcrypt_create_iv()</b> to initialize the random number generator; it is not seeded automatically like <a href='http://www.php.net/manual/en/function.rand.php' class='function'>rand()</a> is. <br /> </p></blockquote> </dd> </dl> <p> </p> </div> <a name='function.mcrypt-create-iv.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the initialization vector, or <b><tt class='constant'>FALSE</tt></b> on error. </p> </div> <a name='function.mcrypt-create-iv.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>mcrypt_create_iv()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$size&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_get_iv_size</span><span style='color: #007700'>(</span><span style='color: #0000BB'>MCRYPT_CAST_256</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>MCRYPT_MODE_CFB</span><span style='color: #007700'>);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$iv&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>mcrypt_create_iv</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$size</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>MCRYPT_DEV_RANDOM</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.mcrypt-create-iv.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.ciphersbyritter.com/GLOSSARY.HTM#IV' class='link external'>&amp;raquo; http://www.ciphersbyritter.com/GLOSSARY.HTM#IV</a></li> <li class='member'><a href='http://www.quadibloc.com/crypto/co0409.htm' class='link external'>&amp;raquo; http://www.quadibloc.com/crypto/co0409.htm</a></li> <li class='member'>Chapter 9.3 of Applied Cryptography by Schneier (ISBN 0-471-11709-9)</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_cfb" value="<div id='function.mcrypt-cfb' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-cfb.php'>mcrypt_cfb</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_cfb</span> &amp;mdash; <span class='dc-title'>Encrypt/decrypt data in CFB mode</span></p> </div> <a name='function.mcrypt-cfb.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mcrypt_cfb</b></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$cipher</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$key</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$mode</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$iv</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mcrypt_cfb</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$cipher</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$key</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$mode</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$iv</tt></span> ] )</div> <p class='para rdfs-comment'> The first prototype is when linked against libmcrypt 2.2.x, the second when linked against libmcrypt 2.4.x or higher. The <i><tt class='parameter'>mode</tt></i> should be either <b><tt class='constant'>MCRYPT_ENCRYPT</tt></b> or <b><tt class='constant'>MCRYPT_DECRYPT</tt></b>. </p> <p class='para'> This function should not be used anymore, see <a href='http://www.php.net/manual/en/function.mcrypt-generic.php' class='function'>mcrypt_generic()</a> and <a href='http://www.php.net/manual/en/function.mdecrypt-generic.php' class='function'>mdecrypt_generic()</a> for replacements. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="mcrypt_cbc" value="<div id='function.mcrypt-cbc' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.mcrypt-cbc.php'>mcrypt_cbc</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>mcrypt_cbc</span> &amp;mdash; <span class='dc-title'>Encrypt/decrypt data in CBC mode</span></p> </div> <a name='function.mcrypt-cbc.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mcrypt_cbc</b></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$cipher</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$key</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$mode</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$iv</tt></span> ] )</div> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>mcrypt_cbc</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$cipher</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$key</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$mode</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$iv</tt></span> ] )</div> <p class='para rdfs-comment'> The first prototype is when linked against libmcrypt 2.2.x, the second when linked against libmcrypt 2.4.x or higher. The <i><tt class='parameter'>mode</tt></i> should be either <b><tt class='constant'>MCRYPT_ENCRYPT</tt></b> or <b><tt class='constant'>MCRYPT_DECRYPT</tt></b>. </p> <p class='para'> This function should not be used anymore, see <a href='http://www.php.net/manual/en/function.mcrypt-generic.php' class='function'>mcrypt_generic()</a> and <a href='http://www.php.net/manual/en/function.mdecrypt-generic.php' class='function'>mdecrypt_generic()</a> for replacements. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="hash_update_stream" value="<div id='function.hash-update-stream' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.hash-update-stream.php'>hash_update_stream</a></h1> <p class='verinfo'>(PHP 5 &amp;gt;= 5.1.2, PECL hash &amp;gt;= 1.1)</p><p class='refpurpose'><span class='refname'>hash_update_stream</span> &amp;mdash; <span class='dc-title'>Pump data into an active hashing context from an open stream</span></p> </div> <a name='function.hash-update-stream.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>hash_update_stream</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$context</tt></span> , <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$handle</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$length</tt><span class='initializer'> = -1</span></span> ] )</div> </div> <a name='function.hash-update-stream.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>context</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Hashing context returned by <a href='http://www.php.net/manual/en/function.hash-init.php' class='function'>hash_init()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>handle</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Open file handle as returned by any stream creation function. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>length</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Maximum number of characters to copy from <i><tt class='parameter'>handle</tt></i> into the hashing context. </p> </dd> </dl> <p> </p> </div> <a name='function.hash-update-stream.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Actual number of bytes added to the hashing context from <i><tt class='parameter'>handle</tt></i> . </p> </div> <a name='function.hash-update-stream.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>hash_update_stream()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$fp&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>tmpfile</span><span style='color: #007700'>();<br /></span><span style='color: #0000BB'>fwrite</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'The&amp;nbsp;quick&amp;nbsp;brown&amp;nbsp;fox&amp;nbsp;jumped&amp;nbsp;over&amp;nbsp;the&amp;nbsp;lazy&amp;nbsp;dog.'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>rewind</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>);<br /><br /></span><span style='color: #0000BB'>$ctx&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>hash_init</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'md5'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>hash_update_stream</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$ctx</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>);<br />echo&amp;nbsp;</span><span style='color: #0000BB'>hash_final</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$ctx</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> <div class='example-contents para'><p>The above example will output:</p></div> <div class='example-contents screen'> <div class='cdata'><pre> 5c6ffbdd40d9556b73a21e63c3e0e904 </pre></div> </div> </div><p> </p> </div> <a name='function.hash-update-stream.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.hash-init.php' class='function' rel='rdfs-seeAlso'>hash_init()</a> - Initialize an incremental hashing context</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-update.php' class='function' rel='rdfs-seeAlso'>hash_update()</a> - Pump data into an active hashing context</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-final.php' class='function' rel='rdfs-seeAlso'>hash_final()</a> - Finalize an incremental hash and return resulting digest</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash.php' class='function' rel='rdfs-seeAlso'>hash()</a> - Generate a hash value (message digest)</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-file.php' class='function' rel='rdfs-seeAlso'>hash_file()</a> - Generate a hash value using the contents of a given file</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="hash_update_file" value="<div id='function.hash-update-file' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.hash-update-file.php'>hash_update_file</a></h1> <p class='verinfo'>(PHP 5 &amp;gt;= 5.1.2, PECL hash &amp;gt;= 1.1)</p><p class='refpurpose'><span class='refname'>hash_update_file</span> &amp;mdash; <span class='dc-title'>Pump data into an active hashing context from a file</span></p> </div> <a name='function.hash-update-file.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>hash_update_file</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$context</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$filename</tt></span> [, <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$context</tt><span class='initializer'> = NULL</span></span> ] )</div> </div> <a name='function.hash-update-file.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>context</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Hashing context returned by <a href='http://www.php.net/manual/en/function.hash-init.php' class='function'>hash_init()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>filename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> URL describing location of file to be hashed; Supports fopen wrappers. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>context</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Stream context as returned by <a href='http://www.php.net/manual/en/function.stream-context-create.php' class='function'>stream_context_create()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.hash-update-file.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.hash-update-file.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.hash-init.php' class='function' rel='rdfs-seeAlso'>hash_init()</a> - Initialize an incremental hashing context</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-update.php' class='function' rel='rdfs-seeAlso'>hash_update()</a> - Pump data into an active hashing context</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-update-stream.php' class='function' rel='rdfs-seeAlso'>hash_update_stream()</a> - Pump data into an active hashing context from an open stream</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-final.php' class='function' rel='rdfs-seeAlso'>hash_final()</a> - Finalize an incremental hash and return resulting digest</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash.php' class='function' rel='rdfs-seeAlso'>hash()</a> - Generate a hash value (message digest)</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-file.php' class='function' rel='rdfs-seeAlso'>hash_file()</a> - Generate a hash value using the contents of a given file</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="hash_update" value="<div id='function.hash-update' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.hash-update.php'>hash_update</a></h1> <p class='verinfo'>(PHP 5 &amp;gt;= 5.1.2, PECL hash &amp;gt;= 1.1)</p><p class='refpurpose'><span class='refname'>hash_update</span> &amp;mdash; <span class='dc-title'>Pump data into an active hashing context</span></p> </div> <a name='function.hash-update.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>hash_update</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$context</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> )</div> </div> <a name='function.hash-update.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>context</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Hashing context returned by <a href='http://www.php.net/manual/en/function.hash-init.php' class='function'>hash_init()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Message to be included in the hash digest. </p> </dd> </dl> <p> </p> </div> <a name='function.hash-update.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b>. </p> </div> <a name='function.hash-update.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.hash-init.php' class='function' rel='rdfs-seeAlso'>hash_init()</a> - Initialize an incremental hashing context</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-update-file.php' class='function' rel='rdfs-seeAlso'>hash_update_file()</a> - Pump data into an active hashing context from a file</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-update-stream.php' class='function' rel='rdfs-seeAlso'>hash_update_stream()</a> - Pump data into an active hashing context from an open stream</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-final.php' class='function' rel='rdfs-seeAlso'>hash_final()</a> - Finalize an incremental hash and return resulting digest</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="hash_init" value="<div id='function.hash-init' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.hash-init.php'>hash_init</a></h1> <p class='verinfo'>(PHP 5 &amp;gt;= 5.1.2, PECL hash &amp;gt;= 1.1)</p><p class='refpurpose'><span class='refname'>hash_init</span> &amp;mdash; <span class='dc-title'>Initialize an incremental hashing context</span></p> </div> <a name='function.hash-init.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>resource</span> <span class='methodname'><b>hash_init</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$algo</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$options</tt><span class='initializer'> = 0</span></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$key</tt><span class='initializer'> = NULL</span></span> ]] )</div> </div> <a name='function.hash-init.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>algo</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Name of selected hashing algorithm (i.e. &amp;quot;md5&amp;quot;, &amp;quot;sha256&amp;quot;, &amp;quot;haval160,4&amp;quot;, etc..) </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>options</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Optional settings for hash generation, currently supports only one option: <b><tt class='constant'>HASH_HMAC</tt></b>. When specified, the <i><tt class='parameter'>key</tt></i> <em class='emphasis'>must</em> be specified. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> When <b><tt class='constant'>HASH_HMAC</tt></b> is specified for <i><tt class='parameter'>options</tt></i> , a shared secret key to be used with the HMAC hashing method must be supplied in this parameter. </p> </dd> </dl> <p> </p> </div> <a name='function.hash-init.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns a Hashing Context resource for use with <a href='http://www.php.net/manual/en/function.hash-update.php' class='function'>hash_update()</a>, <a href='http://www.php.net/manual/en/function.hash-update-stream.php' class='function'>hash_update_stream()</a>, <a href='http://www.php.net/manual/en/function.hash-update-file.php' class='function'>hash_update_file()</a>, and <a href='http://www.php.net/manual/en/function.hash-final.php' class='function'>hash_final()</a>. </p> </div> <a name='function.hash-init.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 Incremental hashing example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$ctx&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>hash_init</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'md5'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>hash_update</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$ctx</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'The&amp;nbsp;quick&amp;nbsp;brown&amp;nbsp;fox&amp;nbsp;'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>hash_update</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$ctx</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'jumped&amp;nbsp;over&amp;nbsp;the&amp;nbsp;lazy&amp;nbsp;dog.'</span><span style='color: #007700'>);<br />echo&amp;nbsp;</span><span style='color: #0000BB'>hash_final</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$ctx</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> <div class='example-contents para'><p>The above example will output:</p></div> <div class='example-contents screen'> <div class='cdata'><pre> 5c6ffbdd40d9556b73a21e63c3e0e904 </pre></div> </div> </div><p> </p> </div> <a name='function.hash-init.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.hash.php' class='function' rel='rdfs-seeAlso'>hash()</a> - Generate a hash value (message digest)</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-file.php' class='function' rel='rdfs-seeAlso'>hash_file()</a> - Generate a hash value using the contents of a given file</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-hmac.php' class='function' rel='rdfs-seeAlso'>hash_hmac()</a> - Generate a keyed hash value using the HMAC method</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-hmac-file.php' class='function' rel='rdfs-seeAlso'>hash_hmac_file()</a> - Generate a keyed hash value using the HMAC method and the contents of a given file</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="hash_hmac_file" value="<div id='function.hash-hmac-file' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.hash-hmac-file.php'>hash_hmac_file</a></h1> <p class='verinfo'>(PHP 5 &amp;gt;= 5.1.2, PECL hash &amp;gt;= 1.1)</p><p class='refpurpose'><span class='refname'>hash_hmac_file</span> &amp;mdash; <span class='dc-title'>Generate a keyed hash value using the HMAC method and the contents of a given file</span></p> </div> <a name='function.hash-hmac-file.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>hash_hmac_file</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$algo</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$filename</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$key</tt></span> [, <span class='methodparam'><span class='type'>bool</span> <tt class='parameter'>$raw_output</tt><span class='initializer'> = false</span></span> ] )</div> </div> <a name='function.hash-hmac-file.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>algo</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Name of selected hashing algorithm (i.e. &amp;quot;md5&amp;quot;, &amp;quot;sha256&amp;quot;, &amp;quot;haval160,4&amp;quot;, etc..) </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>filename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> URL describing location of file to be hashed; Supports fopen wrappers. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Shared secret key used for generating the HMAC variant of the message digest. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>raw_output</tt></i> </span> </dt><dd class='listitem'> <p class='para'> When set to <b><tt class='constant'>TRUE</tt></b>, outputs raw binary data. Default value (<b><tt class='constant'>FALSE</tt></b>) outputs lowercase hexits. </p> </dd> </dl> <p> </p> </div> <a name='function.hash-hmac-file.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns a string containing the calculated message digest as lowercase hexits unless <i><tt class='parameter'>raw_output</tt></i> is set to true in which case the raw binary representation of the message digest is returned. </p> </div> <a name='function.hash-hmac-file.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>hash_hmac_file()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /></span><span style='color: #FF8000'>/*&amp;nbsp;Create&amp;nbsp;a&amp;nbsp;file&amp;nbsp;to&amp;nbsp;calculate&amp;nbsp;hash&amp;nbsp;of&amp;nbsp;*/<br /></span><span style='color: #0000BB'>file_put_contents</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'example.txt'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'The&amp;nbsp;quick&amp;nbsp;brown&amp;nbsp;fox&amp;nbsp;jumped&amp;nbsp;over&amp;nbsp;the&amp;nbsp;lazy&amp;nbsp;dog.'</span><span style='color: #007700'>);<br /><br />echo&amp;nbsp;</span><span style='color: #0000BB'>hash_hmac_file</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'md5'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'example.txt'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'secret'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> <div class='example-contents para'><p>The above example will output:</p></div> <div class='example-contents screen'> <div class='cdata'><pre> 7eb2b5c37443418fc77c136dd20e859c </pre></div> </div> </div><p> </p> </div> <a name='function.hash-hmac-file.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.hash-hmac.php' class='function' rel='rdfs-seeAlso'>hash_hmac()</a> - Generate a keyed hash value using the HMAC method</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-file.php' class='function' rel='rdfs-seeAlso'>hash_file()</a> - Generate a hash value using the contents of a given file</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="hash_hmac" value="<div id='function.hash-hmac' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.hash-hmac.php'>hash_hmac</a></h1> <p class='verinfo'>(PHP 5 &amp;gt;= 5.1.2, PECL hash &amp;gt;= 1.1)</p><p class='refpurpose'><span class='refname'>hash_hmac</span> &amp;mdash; <span class='dc-title'>Generate a keyed hash value using the HMAC method</span></p> </div> <a name='function.hash-hmac.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>hash_hmac</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$algo</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$key</tt></span> [, <span class='methodparam'><span class='type'>bool</span> <tt class='parameter'>$raw_output</tt><span class='initializer'> = false</span></span> ] )</div> </div> <a name='function.hash-hmac.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>algo</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Name of selected hashing algorithm (i.e. &amp;quot;md5&amp;quot;, &amp;quot;sha256&amp;quot;, &amp;quot;haval160,4&amp;quot;, etc..) </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Message to be hashed. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>key</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Shared secret key used for generating the HMAC variant of the message digest. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>raw_output</tt></i> </span> </dt><dd class='listitem'> <p class='para'> When set to <b><tt class='constant'>TRUE</tt></b>, outputs raw binary data. Default value (<b><tt class='constant'>FALSE</tt></b>) outputs lowercase hexits. </p> </dd> </dl> <p> </p> </div> <a name='function.hash-hmac.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns a string containing the calculated message digest as lowercase hexits unless <i><tt class='parameter'>raw_output</tt></i> is set to true in which case the raw binary representation of the message digest is returned. </p> </div> <a name='function.hash-hmac.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>hash_hmac()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /></span><span style='color: #007700'>echo&amp;nbsp;</span><span style='color: #0000BB'>hash_hmac</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'ripemd160'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'The&amp;nbsp;quick&amp;nbsp;brown&amp;nbsp;fox&amp;nbsp;jumped&amp;nbsp;over&amp;nbsp;the&amp;nbsp;lazy&amp;nbsp;dog.'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'secret'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> <div class='example-contents para'><p>The above example will output:</p></div> <div class='example-contents screen'> <div class='cdata'><pre> b8e7ae12510bdfb1812e463a7f086122cf37e4f7 </pre></div> </div> </div><p> </p> </div> <a name='function.hash-hmac.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.hash.php' class='function' rel='rdfs-seeAlso'>hash()</a> - Generate a hash value (message digest)</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-init.php' class='function' rel='rdfs-seeAlso'>hash_init()</a> - Initialize an incremental hashing context</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-hmac-file.php' class='function' rel='rdfs-seeAlso'>hash_hmac_file()</a> - Generate a keyed hash value using the HMAC method and the contents of a given file</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="hash_final" value="<div id='function.hash-final' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.hash-final.php'>hash_final</a></h1> <p class='verinfo'>(PHP 5 &amp;gt;= 5.1.2, PECL hash &amp;gt;= 1.1)</p><p class='refpurpose'><span class='refname'>hash_final</span> &amp;mdash; <span class='dc-title'>Finalize an incremental hash and return resulting digest</span></p> </div> <a name='function.hash-final.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>hash_final</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$context</tt></span> [, <span class='methodparam'><span class='type'>bool</span> <tt class='parameter'>$raw_output</tt><span class='initializer'> = false</span></span> ] )</div> </div> <a name='function.hash-final.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>context</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Hashing context returned by <a href='http://www.php.net/manual/en/function.hash-init.php' class='function'>hash_init()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>raw_output</tt></i> </span> </dt><dd class='listitem'> <p class='para'> When set to <b><tt class='constant'>TRUE</tt></b>, outputs raw binary data. Default value (<b><tt class='constant'>FALSE</tt></b>) outputs lowercase hexits. </p> </dd> </dl> <p> </p> </div> <a name='function.hash-final.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns a string containing the calculated message digest as lowercase hexits unless <i><tt class='parameter'>raw_output</tt></i> is set to true in which case the raw binary representation of the message digest is returned. </p> </div> <a name='function.hash-final.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>hash_final()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$ctx&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>hash_init</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'sha1'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>hash_update</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$ctx</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'The&amp;nbsp;quick&amp;nbsp;brown&amp;nbsp;fox&amp;nbsp;jumped&amp;nbsp;over&amp;nbsp;the&amp;nbsp;lazy&amp;nbsp;dog.'</span><span style='color: #007700'>);<br />echo&amp;nbsp;</span><span style='color: #0000BB'>hash_final</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$ctx</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> <div class='example-contents para'><p>The above example will output:</p></div> <div class='example-contents screen'> <div class='cdata'><pre> c0854fb9fb03c41cce3802cb0d220529e6eef94e </pre></div> </div> </div><p> </p> </div> <a name='function.hash-final.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.hash-init.php' class='function' rel='rdfs-seeAlso'>hash_init()</a> - Initialize an incremental hashing context</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-update.php' class='function' rel='rdfs-seeAlso'>hash_update()</a> - Pump data into an active hashing context</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-update-stream.php' class='function' rel='rdfs-seeAlso'>hash_update_stream()</a> - Pump data into an active hashing context from an open stream</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-update-file.php' class='function' rel='rdfs-seeAlso'>hash_update_file()</a> - Pump data into an active hashing context from a file</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="hash_file" value="<div id='function.hash-file' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.hash-file.php'>hash_file</a></h1> <p class='verinfo'>(PHP 5 &amp;gt;= 5.1.2, PECL hash &amp;gt;= 1.1)</p><p class='refpurpose'><span class='refname'>hash_file</span> &amp;mdash; <span class='dc-title'>Generate a hash value using the contents of a given file</span></p> </div> <a name='function.hash-file.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>hash_file</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$algo</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$filename</tt></span> [, <span class='methodparam'><span class='type'>bool</span> <tt class='parameter'>$raw_output</tt><span class='initializer'> = false</span></span> ] )</div> </div> <a name='function.hash-file.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>algo</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Name of selected hashing algorithm (i.e. &amp;quot;md5&amp;quot;, &amp;quot;sha256&amp;quot;, &amp;quot;haval160,4&amp;quot;, etc..) </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>filename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> URL describing location of file to be hashed; Supports fopen wrappers. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>raw_output</tt></i> </span> </dt><dd class='listitem'> <p class='para'> When set to <b><tt class='constant'>TRUE</tt></b>, outputs raw binary data. Default value (<b><tt class='constant'>FALSE</tt></b>) outputs lowercase hexits. </p> </dd> </dl> <p> </p> </div> <a name='function.hash-file.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns a string containing the calculated message digest as lowercase hexits unless <i><tt class='parameter'>raw_output</tt></i> is set to true in which case the raw binary representation of the message digest is returned. </p> </div> <a name='function.hash-file.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 Using <b>hash_file()</b></b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /></span><span style='color: #FF8000'>/*&amp;nbsp;Create&amp;nbsp;a&amp;nbsp;file&amp;nbsp;to&amp;nbsp;calculate&amp;nbsp;hash&amp;nbsp;of&amp;nbsp;*/<br /></span><span style='color: #0000BB'>file_put_contents</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'example.txt'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'The&amp;nbsp;quick&amp;nbsp;brown&amp;nbsp;fox&amp;nbsp;jumped&amp;nbsp;over&amp;nbsp;the&amp;nbsp;lazy&amp;nbsp;dog.'</span><span style='color: #007700'>);<br /><br />echo&amp;nbsp;</span><span style='color: #0000BB'>hash_file</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'md5'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'example.txt'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> <div class='example-contents para'><p>The above example will output:</p></div> <div class='example-contents screen'> <div class='cdata'><pre> 5c6ffbdd40d9556b73a21e63c3e0e904 </pre></div> </div> </div><p> </p> </div> <a name='function.hash-file.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.hash.php' class='function' rel='rdfs-seeAlso'>hash()</a> - Generate a hash value (message digest)</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-hmac-file.php' class='function' rel='rdfs-seeAlso'>hash_hmac_file()</a> - Generate a keyed hash value using the HMAC method and the contents of a given file</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-update-file.php' class='function' rel='rdfs-seeAlso'>hash_update_file()</a> - Pump data into an active hashing context from a file</li> <li class='member'><a href='http://www.php.net/manual/en/function.md5-file.php' class='function' rel='rdfs-seeAlso'>md5_file()</a> - Calculates the md5 hash of a given file</li> <li class='member'><a href='http://www.php.net/manual/en/function.sha1-file.php' class='function' rel='rdfs-seeAlso'>sha1_file()</a> - Calculate the sha1 hash of a file</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="hash_algos" value="<div id='function.hash-algos' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.hash-algos.php'>hash_algos</a></h1> <p class='verinfo'>(PHP 5 &amp;gt;= 5.1.2, PECL hash &amp;gt;= 1.1)</p><p class='refpurpose'><span class='refname'>hash_algos</span> &amp;mdash; <span class='dc-title'>Return a list of registered hashing algorithms</span></p> </div> <a name='function.hash-algos.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>array</span> <span class='methodname'><b>hash_algos</b></span> ( <span class='methodparam'>void</span> )</div> </div> <a name='function.hash-algos.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns a numerically indexed array containing the list of supported hashing algorithms. </p> </div> <a name='function.hash-algos.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>hash_algos()</b> example</b></p> <div class='example-contents para'><p> As of PHP 5.1.2, <b>hash_algos()</b> will return the following list of algorithm names. </p></div> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />print_r</span><span style='color: #007700'>(</span><span style='color: #0000BB'>hash_algos</span><span style='color: #007700'>());<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> <div class='example-contents para'><p>The above example will output:</p></div> <div class='example-contents screen'> <div class='cdata'><pre> Array ( [0] =&amp;gt; md4 [1] =&amp;gt; md5 [2] =&amp;gt; sha1 [3] =&amp;gt; sha256 [4] =&amp;gt; sha384 [5] =&amp;gt; sha512 [6] =&amp;gt; ripemd128 [7] =&amp;gt; ripemd160 [8] =&amp;gt; whirlpool [9] =&amp;gt; tiger128,3 [10] =&amp;gt; tiger160,3 [11] =&amp;gt; tiger192,3 [12] =&amp;gt; tiger128,4 [13] =&amp;gt; tiger160,4 [14] =&amp;gt; tiger192,4 [15] =&amp;gt; snefru [16] =&amp;gt; gost [17] =&amp;gt; adler32 [18] =&amp;gt; crc32 [19] =&amp;gt; crc32b [20] =&amp;gt; haval128,3 [21] =&amp;gt; haval160,3 [22] =&amp;gt; haval192,3 [23] =&amp;gt; haval224,3 [24] =&amp;gt; haval256,3 [25] =&amp;gt; haval128,4 [26] =&amp;gt; haval160,4 [27] =&amp;gt; haval192,4 [28] =&amp;gt; haval224,4 [29] =&amp;gt; haval256,4 [30] =&amp;gt; haval128,5 [31] =&amp;gt; haval160,5 [32] =&amp;gt; haval192,5 [33] =&amp;gt; haval224,5 [34] =&amp;gt; haval256,5 ) </pre></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="hash" value="<div id='function.hash' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.hash.php'>hash</a></h1> <p class='verinfo'>(PHP 5 &amp;gt;= 5.1.2, PECL hash &amp;gt;= 1.1)</p><p class='refpurpose'><span class='refname'>hash</span> &amp;mdash; <span class='dc-title'>Generate a hash value (message digest)</span></p> </div> <a name='function.hash.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>hash</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$algo</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> [, <span class='methodparam'><span class='type'>bool</span> <tt class='parameter'>$raw_output</tt><span class='initializer'> = false</span></span> ] )</div> </div> <a name='function.hash.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>algo</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Name of selected hashing algorithm (i.e. &amp;quot;md5&amp;quot;, &amp;quot;sha256&amp;quot;, &amp;quot;haval160,4&amp;quot;, etc..) </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Message to be hashed. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>raw_output</tt></i> </span> </dt><dd class='listitem'> <p class='para'> When set to <b><tt class='constant'>TRUE</tt></b>, outputs raw binary data. Default value (<b><tt class='constant'>FALSE</tt></b>) outputs lowercase hexits. </p> </dd> </dl> <p> </p> </div> <a name='function.hash.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns a string containing the calculated message digest as lowercase hexits unless <i><tt class='parameter'>raw_output</tt></i> is set to true in which case the raw binary representation of the message digest is returned. </p> </div> <a name='function.hash.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 A <b>hash()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /></span><span style='color: #007700'>echo&amp;nbsp;</span><span style='color: #0000BB'>hash</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'ripemd160'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'The&amp;nbsp;quick&amp;nbsp;brown&amp;nbsp;fox&amp;nbsp;jumped&amp;nbsp;over&amp;nbsp;the&amp;nbsp;lazy&amp;nbsp;dog.'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> <div class='example-contents para'><p>The above example will output:</p></div> <div class='example-contents screen'> <div class='cdata'><pre> ec457d0a974c48d5685a7efa03d137dc8bbde7e3 </pre></div> </div> </div><p> </p> </div> <a name='function.hash.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.hash-file.php' class='function' rel='rdfs-seeAlso'>hash_file()</a> - Generate a hash value using the contents of a given file</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-hmac.php' class='function' rel='rdfs-seeAlso'>hash_hmac()</a> - Generate a keyed hash value using the HMAC method</li> <li class='member'><a href='http://www.php.net/manual/en/function.hash-init.php' class='function' rel='rdfs-seeAlso'>hash_init()</a> - Initialize an incremental hashing context</li> <li class='member'><a href='http://www.php.net/manual/en/function.md5.php' class='function' rel='rdfs-seeAlso'>md5()</a> - Calculate the md5 hash of a string</li> <li class='member'><a href='http://www.php.net/manual/en/function.sha1.php' class='function' rel='rdfs-seeAlso'>sha1()</a> - Calculate the sha1 hash of a string</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzwrite" value="<div id='function.gzwrite' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzwrite.php'>gzwrite</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>gzwrite</span> &amp;mdash; <span class='dc-title'>Binary-safe gz-file write</span></p> </div> <a name='function.gzwrite.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>gzwrite</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zp</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$string</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$length</tt></span> ] )</div> <p class='para rdfs-comment'> <b>gzwrite()</b> writes the contents of <i><tt class='parameter'>string</tt></i> to the given gz-file. </p> </div> <a name='function.gzwrite.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zp</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The gz-file pointer. It must be valid, and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.gzopen.php' class='function'>gzopen()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>string</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The string to write. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>length</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The number of uncompressed bytes to write. If supplied, writing will stop after <i><tt class='parameter'>length</tt></i> (uncompressed) bytes have been written or the end of <i><tt class='parameter'>string</tt></i> is reached, whichever comes first. </p> <blockquote><p><b class='note'>Note</b>: Note that if the <i><tt class='parameter'>length</tt></i> argument is given, then the <a href='http://www.php.net/manual/en/info.configuration.php#ini.magic-quotes-runtime' class='link'>magic_quotes_runtime</a> configuration option will be ignored and no slashes will be stripped from <i><tt class='parameter'>string</tt></i> . <br /> </p></blockquote> </dd> </dl> <p> </p> </div> <a name='function.gzwrite.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the number of (uncompressed) bytes written to the given gz-file stream. </p> </div> <a name='function.gzwrite.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>gzwrite()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$string&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #DD0000'>'Some&amp;nbsp;information&amp;nbsp;to&amp;nbsp;compress'</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>$gz&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'somefile.gz'</span><span style='color: #007700'>,</span><span style='color: #DD0000'>'w9'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>gzwrite</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$gz</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$string</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>gzclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$gz</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.gzwrite.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.gzread.php' class='function' rel='rdfs-seeAlso'>gzread()</a> - Binary-safe gz-file read</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzopen.php' class='function' rel='rdfs-seeAlso'>gzopen()</a> - Open gz-file</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzuncompress" value="<div id='function.gzuncompress' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzuncompress.php'>gzuncompress</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.1, PHP 5)</p><p class='refpurpose'><span class='refname'>gzuncompress</span> &amp;mdash; <span class='dc-title'>Uncompress a compressed string</span></p> </div> <a name='function.gzuncompress.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>gzuncompress</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$length</tt><span class='initializer'> = 0</span></span> ] )</div> <p class='para rdfs-comment'> This function uncompress a compressed string. </p> </div> <a name='function.gzuncompress.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The data compressed by <a href='http://www.php.net/manual/en/function.gzcompress.php' class='function'>gzcompress()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>length</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The maximum length of data to decode. </p> </dd> </dl> <p> </p> </div> <a name='function.gzuncompress.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The original uncompressed data or <b><tt class='constant'>FALSE</tt></b> on error. </p> <p class='para'> The function will return an error if the uncompressed data is more than 32768 times the length of the compressed input <i><tt class='parameter'>data</tt></i> or more than the optional parameter <i><tt class='parameter'>length</tt></i> . </p> </div> <a name='function.gzuncompress.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>gzuncompress()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$compressed&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzcompress</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'Compress&amp;nbsp;me'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>9</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>$uncompressed&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzuncompress</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$compressed</span><span style='color: #007700'>);<br />echo&amp;nbsp;</span><span style='color: #0000BB'>$uncompressed</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.gzuncompress.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.gzcompress.php' class='function' rel='rdfs-seeAlso'>gzcompress()</a> - Compress a string</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzinflate.php' class='function' rel='rdfs-seeAlso'>gzinflate()</a> - Inflate a deflated string</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzdeflate.php' class='function' rel='rdfs-seeAlso'>gzdeflate()</a> - Deflate a string</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzencode.php' class='function' rel='rdfs-seeAlso'>gzencode()</a> - Create a gzip compressed string</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gztell" value="<div id='function.gztell' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gztell.php'>gztell</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>gztell</span> &amp;mdash; <span class='dc-title'>Tell gz-file pointer read/write position</span></p> </div> <a name='function.gztell.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>gztell</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zp</tt></span> )</div> <p class='para rdfs-comment'> Gets the position of the given file pointer; i.e., its offset into the uncompressed file stream. </p> </div> <a name='function.gztell.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zp</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The gz-file pointer. It must be valid, and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.gzopen.php' class='function'>gzopen()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.gztell.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The position of the file pointer or <b><tt class='constant'>FALSE</tt></b> if an error occurs. </p> </div> <a name='function.gztell.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.gzopen.php' class='function' rel='rdfs-seeAlso'>gzopen()</a> - Open gz-file</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzseek.php' class='function' rel='rdfs-seeAlso'>gzseek()</a> - Seek on a gz-file pointer</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzrewind.php' class='function' rel='rdfs-seeAlso'>gzrewind()</a> - Rewind the position of a gz-file pointer</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzseek" value="<div id='function.gzseek' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzseek.php'>gzseek</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>gzseek</span> &amp;mdash; <span class='dc-title'>Seek on a gz-file pointer</span></p> </div> <a name='function.gzseek.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>gzseek</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zp</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$offset</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$whence</tt><span class='initializer'> = SEEK_SET</span></span> ] )</div> <p class='para rdfs-comment'> Sets the file position indicator for the given file pointer to the given offset byte into the file stream. Equivalent to calling (in C) <i>gzseek(zp, offset, SEEK_SET)</i>. </p> <p class='para'> If the file is opened for reading, this function is emulated but can be extremely slow. If the file is opened for writing, only forward seeks are supported; <b>gzseek()</b> then compresses a sequence of zeroes up to the new starting position. </p> </div> <a name='function.gzseek.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zp</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The gz-file pointer. It must be valid, and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.gzopen.php' class='function'>gzopen()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>offset</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The seeked offset. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>whence</tt></i> </span> </dt><dd class='listitem'> <p class='para'> <i><tt class='parameter'>whence</tt></i> values are: </p><ul class='simplelist'> <li class='member'><b><tt class='constant'>SEEK_SET</tt></b> - Set position equal to <i><tt class='parameter'>offset</tt></i> bytes.</li> <li class='member'><b><tt class='constant'>SEEK_CUR</tt></b> - Set position to current location plus <i><tt class='parameter'>offset</tt></i> .</li> </ul><p> </p> <p class='para'> If <i><tt class='parameter'>whence</tt></i> is not specified, it is assumed to be <b><tt class='constant'>SEEK_SET</tt></b>. </p> </dd> </dl> <p> </p> </div> <a name='function.gzseek.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Upon success, returns 0; otherwise, returns -1. Note that seeking past EOF is not considered an error. </p> </div> <a name='function.gzseek.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>gzseek()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$gz&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'somefile.gz'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'r'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>gzseek</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$gz</span><span style='color: #007700'>,</span><span style='color: #0000BB'>2</span><span style='color: #007700'>);<br />echo&amp;nbsp;</span><span style='color: #0000BB'>gzgetc</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$gz</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>gzclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$gz</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.gzseek.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.gztell.php' class='function' rel='rdfs-seeAlso'>gztell()</a> - Tell gz-file pointer read/write position</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzrewind.php' class='function' rel='rdfs-seeAlso'>gzrewind()</a> - Rewind the position of a gz-file pointer</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzrewind" value="<div id='function.gzrewind' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzrewind.php'>gzrewind</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>gzrewind</span> &amp;mdash; <span class='dc-title'>Rewind the position of a gz-file pointer</span></p> </div> <a name='function.gzrewind.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>gzrewind</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zp</tt></span> )</div> <p class='para rdfs-comment'> Sets the file position indicator of the given gz-file pointer to the beginning of the file stream. </p> </div> <a name='function.gzrewind.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zp</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The gz-file pointer. It must be valid, and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.gzopen.php' class='function'>gzopen()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.gzrewind.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.gzrewind.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.gzseek.php' class='function' rel='rdfs-seeAlso'>gzseek()</a> - Seek on a gz-file pointer</li> <li class='member'><a href='http://www.php.net/manual/en/function.gztell.php' class='function' rel='rdfs-seeAlso'>gztell()</a> - Tell gz-file pointer read/write position</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzread" value="<div id='function.gzread' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzread.php'>gzread</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>gzread</span> &amp;mdash; <span class='dc-title'>Binary-safe gz-file read</span></p> </div> <a name='function.gzread.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>gzread</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zp</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$length</tt></span> )</div> <p class='para rdfs-comment'> <b>gzread()</b> reads up to <i><tt class='parameter'>length</tt></i> bytes from the given gz-file pointer. Reading stops when <i><tt class='parameter'>length</tt></i> (uncompressed) bytes have been read or <acronym title='End Of File'>EOF</acronym> is reached, whichever comes first. </p> </div> <a name='function.gzread.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zp</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The gz-file pointer. It must be valid, and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.gzopen.php' class='function'>gzopen()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>length</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The number of bytes to read. </p> </dd> </dl> <p> </p> </div> <a name='function.gzread.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The data that have been read. </p> </div> <a name='function.gzread.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>gzread()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /></span><span style='color: #FF8000'>//&amp;nbsp;get&amp;nbsp;contents&amp;nbsp;of&amp;nbsp;a&amp;nbsp;gz-file&amp;nbsp;into&amp;nbsp;a&amp;nbsp;string<br /></span><span style='color: #0000BB'>$filename&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #DD0000'>'/usr/local/something.txt.gz'</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>$zd&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzopen</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$filename</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'r'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>$contents&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzread</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$zd</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>10000</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>gzclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$zd</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.gzread.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.gzwrite.php' class='function' rel='rdfs-seeAlso'>gzwrite()</a> - Binary-safe gz-file write</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzopen.php' class='function' rel='rdfs-seeAlso'>gzopen()</a> - Open gz-file</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzgets.php' class='function' rel='rdfs-seeAlso'>gzgets()</a> - Get line from file pointer</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzgetss.php' class='function' rel='rdfs-seeAlso'>gzgetss()</a> - Get line from gz-file pointer and strip HTML tags</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzfile.php' class='function' rel='rdfs-seeAlso'>gzfile()</a> - Read entire gz-file into an array</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzpassthru.php' class='function' rel='rdfs-seeAlso'>gzpassthru()</a> - Output all remaining data on a gz-file pointer</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzputs" value="<div id='function.gzputs' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzputs.php'>gzputs</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>gzputs</span> &amp;mdash; <span class='dc-title'>Alias of <a href='http://www.php.net/manual/en/function.gzwrite.php' class='function'>gzwrite()</a></span></p> </div> <a name='function.gzputs.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <p class='simpara'> This function is an alias of: <a href='http://www.php.net/manual/en/function.gzwrite.php' class='function'>gzwrite()</a>. </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzpassthru" value="<div id='function.gzpassthru' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzpassthru.php'>gzpassthru</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>gzpassthru</span> &amp;mdash; <span class='dc-title'> Output all remaining data on a gz-file pointer </span></p> </div> <a name='function.gzpassthru.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>gzpassthru</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zp</tt></span> )</div> <p class='para rdfs-comment'> Reads to <acronym title='End Of File'>EOF</acronym> on the given gz-file pointer from the current position and writes the (uncompressed) results to standard output. </p> <blockquote><p><b class='note'>Note</b>: You may need to call <a href='http://www.php.net/manual/en/function.gzrewind.php' class='function'>gzrewind()</a> to reset the file pointer to the beginning of the file if you have already written data to it. <br /> </p></blockquote> <div class='tip'><b class='tip'>Tip</b> <p class='para'> If you just want to dump the contents of a file to the output buffer, without first modifying it or seeking to a particular offset, you may want to use the <a href='http://www.php.net/manual/en/function.readgzfile.php' class='function'>readgzfile()</a> function, which saves you the <a href='http://www.php.net/manual/en/function.gzopen.php' class='function'>gzopen()</a> call. </p> </div> </div> <a name='function.gzpassthru.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zp</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The gz-file pointer. It must be valid, and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.gzopen.php' class='function'>gzopen()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.gzpassthru.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The number of uncompressed characters read from <i><tt class='parameter'>gz</tt></i> and passed through to the input, or <b><tt class='constant'>FALSE</tt></b> on error. </p> </div> <a name='function.gzpassthru.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>gzpassthru()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$fp&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'file.gz'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'r'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>gzpassthru</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>gzclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzopen" value="<div id='function.gzopen' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzopen.php'>gzopen</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>gzopen</span> &amp;mdash; <span class='dc-title'>Open gz-file</span></p> </div> <a name='function.gzopen.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>resource</span> <span class='methodname'><b>gzopen</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$filename</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$mode</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$use_include_path</tt><span class='initializer'> = 0</span></span> ] )</div> <p class='para rdfs-comment'> Opens a gzip (.gz) file for reading or writing. </p> <p class='para'> <b>gzopen()</b> can be used to read a file which is not in gzip format; in this case <a href='http://www.php.net/manual/en/function.gzread.php' class='function'>gzread()</a> will directly read from the file without decompression. </p> </div> <a name='function.gzopen.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>filename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The file name. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>mode</tt></i> </span> </dt><dd class='listitem'> <p class='para'> As in <a href='http://www.php.net/manual/en/function.fopen.php' class='function'>fopen()</a> (<i>rb</i> or <i>wb</i>) but can also include a compression level (<i>wb9</i>) or a strategy: <i>f</i> for filtered data as in <i>wb6f</i>, <i>h</i> for <i>Huffman only compression</i> as in <i>wb1h</i>. (See the description of <i>deflateInit2</i> in <var class='filename'>zlib.h</var> for more information about the strategy parameter.) </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>use_include_path</tt></i> </span> </dt><dd class='listitem'> <p class='para'> You can set this optional parameter to <i>1</i>, if you want to search for the file in the <a href='http://www.php.net/manual/en/ini.core.php#ini.include-path' class='link'>include_path</a> too. </p> </dd> </dl> <p> </p> </div> <a name='function.gzopen.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns a file pointer to the file opened, after that, everything you read from this file descriptor will be transparently decompressed and what you write gets compressed. </p> <p class='para'> If the open fails, the function returns <b><tt class='constant'>FALSE</tt></b>. </p> </div> <a name='function.gzopen.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>gzopen()</b> Example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$fp&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'/tmp/file.gz'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'r'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.gzopen.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.gzclose.php' class='function' rel='rdfs-seeAlso'>gzclose()</a> - Close an open gz-file pointer</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzinflate" value="<div id='function.gzinflate' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzinflate.php'>gzinflate</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>gzinflate</span> &amp;mdash; <span class='dc-title'>Inflate a deflated string</span></p> </div> <a name='function.gzinflate.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>gzinflate</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$length</tt><span class='initializer'> = 0</span></span> ] )</div> <p class='para rdfs-comment'> This function inflate a deflated string. </p> </div> <a name='function.gzinflate.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The data compressed by <a href='http://www.php.net/manual/en/function.gzdeflate.php' class='function'>gzdeflate()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>length</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The maximum length of data to decode. </p> </dd> </dl> <p> </p> </div> <a name='function.gzinflate.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The original uncompressed data or <b><tt class='constant'>FALSE</tt></b> on error. </p> <p class='para'> The function will return an error if the uncompressed data is more than 32768 times the length of the compressed input <i><tt class='parameter'>data</tt></i> or more than the optional parameter <i><tt class='parameter'>length</tt></i> . </p> </div> <a name='function.gzinflate.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>gzinflate()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$compressed&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzdeflate</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'Compress&amp;nbsp;me'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>9</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>$uncompressed&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzinflate</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$compressed</span><span style='color: #007700'>);<br />echo&amp;nbsp;</span><span style='color: #0000BB'>$uncompressed</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.gzinflate.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.gzdeflate.php' class='function' rel='rdfs-seeAlso'>gzdeflate()</a> - Deflate a string</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzcompress.php' class='function' rel='rdfs-seeAlso'>gzcompress()</a> - Compress a string</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzuncompress.php' class='function' rel='rdfs-seeAlso'>gzuncompress()</a> - Uncompress a compressed string</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzencode.php' class='function' rel='rdfs-seeAlso'>gzencode()</a> - Create a gzip compressed string</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzgetss" value="<div id='function.gzgetss' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzgetss.php'>gzgetss</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>gzgetss</span> &amp;mdash; <span class='dc-title'> Get line from gz-file pointer and strip HTML tags </span></p> </div> <a name='function.gzgetss.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>gzgetss</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zp</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$length</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$allowable_tags</tt></span> ] )</div> <p class='para rdfs-comment'> Identical to <a href='http://www.php.net/manual/en/function.gzgets.php' class='function'>gzgets()</a>, except that <b>gzgetss()</b> attempts to strip any HTML and PHP tags from the text it reads. </p> </div> <a name='function.gzgetss.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zp</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The gz-file pointer. It must be valid, and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.gzopen.php' class='function'>gzopen()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>length</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The length of data to get. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>allowable_tags</tt></i> </span> </dt><dd class='listitem'> <p class='para'> You can use this optional parameter to specify tags which should not be stripped. </p> </dd> </dl> <p> </p> </div> <a name='function.gzgetss.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The uncompressed and striped string, or <b><tt class='constant'>FALSE</tt></b> on error. </p> </div> <a name='function.gzgetss.changelog'></a><div class='refsect1 changelog'> <h3 class='title'>Changelog</h3> <p class='para'> </p><table class='doctable informaltable'> <thead valign='middle'> <tr valign='middle'> <th>Version</th> <th>Description</th> </tr> </thead> <tbody valign='middle' class='tbody'> <tr valign='middle'> <td align='left'>4.0.0</td> <td align='left'> <i><tt class='parameter'>allowable_tags</tt></i> was added. </td> </tr> </tbody> </table> <p> </p> </div> <a name='function.gzgetss.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>gzgetss()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$handle&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'somefile.gz'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'r'</span><span style='color: #007700'>);<br />while&amp;nbsp;(!</span><span style='color: #0000BB'>gzeof</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$handle</span><span style='color: #007700'>))&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$buffer&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzgetss</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$handle</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>4096</span><span style='color: #007700'>);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #0000BB'>$buffer</span><span style='color: #007700'>;<br />}<br /></span><span style='color: #0000BB'>gzclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$handle</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.gzgetss.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.gzopen.php' class='function' rel='rdfs-seeAlso'>gzopen()</a> - Open gz-file</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzgets.php' class='function' rel='rdfs-seeAlso'>gzgets()</a> - Get line from file pointer</li> <li class='member'><a href='http://www.php.net/manual/en/function.strip-tags.php' class='function' rel='rdfs-seeAlso'>strip_tags()</a> - Strip HTML and PHP tags from a string</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzgets" value="<div id='function.gzgets' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzgets.php'>gzgets</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>gzgets</span> &amp;mdash; <span class='dc-title'>Get line from file pointer</span></p> </div> <a name='function.gzgets.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>gzgets</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zp</tt></span> , <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$length</tt></span> )</div> <p class='para rdfs-comment'> Gets a (uncompressed) string of up to length - 1 bytes read from the given file pointer. Reading ends when length - 1 bytes have been read, on a newline, or on EOF (whichever comes first). </p> </div> <a name='function.gzgets.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zp</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The gz-file pointer. It must be valid, and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.gzopen.php' class='function'>gzopen()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>length</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The length of data to get. </p> </dd> </dl> <p> </p> </div> <a name='function.gzgets.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The uncompressed string, or <b><tt class='constant'>FALSE</tt></b> on error. </p> </div> <a name='function.gzgets.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>gzgets()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$handle&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'somefile.gz'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'r'</span><span style='color: #007700'>);<br />while&amp;nbsp;(!</span><span style='color: #0000BB'>gzeof</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$handle</span><span style='color: #007700'>))&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$buffer&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzgets</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$handle</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>4096</span><span style='color: #007700'>);<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #0000BB'>$buffer</span><span style='color: #007700'>;<br />}<br /></span><span style='color: #0000BB'>gzclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$handle</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.gzgets.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.gzopen.php' class='function' rel='rdfs-seeAlso'>gzopen()</a> - Open gz-file</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzgetc.php' class='function' rel='rdfs-seeAlso'>gzgetc()</a> - Get character from gz-file pointer</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzwrite.php' class='function' rel='rdfs-seeAlso'>gzwrite()</a> - Binary-safe gz-file write</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzgetc" value="<div id='function.gzgetc' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzgetc.php'>gzgetc</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>gzgetc</span> &amp;mdash; <span class='dc-title'>Get character from gz-file pointer</span></p> </div> <a name='function.gzgetc.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>gzgetc</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zp</tt></span> )</div> <p class='para rdfs-comment'> Returns a string containing a single (uncompressed) character read from the given gz-file pointer. </p> </div> <a name='function.gzgetc.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zp</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The gz-file pointer. It must be valid, and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.gzopen.php' class='function'>gzopen()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.gzgetc.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The uncompressed character or <b><tt class='constant'>FALSE</tt></b> on <acronym title='End Of File'>EOF</acronym> (unlike <a href='http://www.php.net/manual/en/function.gzeof.php' class='function'>gzeof()</a>). </p> </div> <a name='function.gzgetc.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>gzgetc()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$gz&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'somefile.gz'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'r'</span><span style='color: #007700'>);<br />while&amp;nbsp;(!</span><span style='color: #0000BB'>gzeof</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$gz</span><span style='color: #007700'>))&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #0000BB'>gzgetc</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$gz</span><span style='color: #007700'>);<br />}<br /></span><span style='color: #0000BB'>gzclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$gz</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.gzgetc.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.gzopen.php' class='function' rel='rdfs-seeAlso'>gzopen()</a> - Open gz-file</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzgets.php' class='function' rel='rdfs-seeAlso'>gzgets()</a> - Get line from file pointer</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzfile" value="<div id='function.gzfile' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzfile.php'>gzfile</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>gzfile</span> &amp;mdash; <span class='dc-title'>Read entire gz-file into an array</span></p> </div> <a name='function.gzfile.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>array</span> <span class='methodname'><b>gzfile</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$filename</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$use_include_path</tt><span class='initializer'> = 0</span></span> ] )</div> <p class='para rdfs-comment'> This function is identical to <a href='http://www.php.net/manual/en/function.readgzfile.php' class='function'>readgzfile()</a>, except that it returns the file in an array. </p> </div> <a name='function.gzfile.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>filename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The file name. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>use_include_path</tt></i> </span> </dt><dd class='listitem'> <p class='para'> You can set this optional parameter to <i>1</i>, if you want to search for the file in the <a href='http://www.php.net/manual/en/ini.core.php#ini.include-path' class='link'>include_path</a> too. </p> </dd> </dl> <p> </p> </div> <a name='function.gzfile.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> An array containing the file, one line per cell. </p> </div> <a name='function.gzfile.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>gzfile()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$lines&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzfile</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'somefile.gz'</span><span style='color: #007700'>);<br />foreach&amp;nbsp;(</span><span style='color: #0000BB'>$lines&amp;nbsp;</span><span style='color: #007700'>as&amp;nbsp;</span><span style='color: #0000BB'>$line</span><span style='color: #007700'>)&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #0000BB'>$line</span><span style='color: #007700'>;<br />}<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.gzfile.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.readgzfile.php' class='function' rel='rdfs-seeAlso'>readgzfile()</a> - Output a gz-file</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzopen.php' class='function' rel='rdfs-seeAlso'>gzopen()</a> - Open gz-file</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzeof" value="<div id='function.gzeof' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzeof.php'>gzeof</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>gzeof</span> &amp;mdash; <span class='dc-title'>Test for <acronym title='End Of File'>EOF</acronym> on a gz-file pointer</span></p> </div> <a name='function.gzeof.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>gzeof</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zp</tt></span> )</div> <p class='para rdfs-comment'> Tests the given GZ file pointer for <acronym title='End Of File'>EOF</acronym>. </p> </div> <a name='function.gzeof.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zp</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The gz-file pointer. It must be valid, and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.gzopen.php' class='function'>gzopen()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.gzeof.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> if the gz-file pointer is at <acronym title='End Of File'>EOF</acronym> or an error occurs; otherwise returns <b><tt class='constant'>FALSE</tt></b>. </p> </div> <a name='function.gzeof.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>gzeof()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$gz&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'somefile.gz'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'r'</span><span style='color: #007700'>);<br />while&amp;nbsp;(!</span><span style='color: #0000BB'>gzeof</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$gz</span><span style='color: #007700'>))&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;echo&amp;nbsp;</span><span style='color: #0000BB'>gzgetc</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$gz</span><span style='color: #007700'>);<br />}<br /></span><span style='color: #0000BB'>gzclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$gz</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzencode" value="<div id='function.gzencode' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzencode.php'>gzencode</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>gzencode</span> &amp;mdash; <span class='dc-title'>Create a gzip compressed string</span></p> </div> <a name='function.gzencode.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>gzencode</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$level</tt><span class='initializer'> = -1</span></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$encoding_mode</tt><span class='initializer'> = FORCE_GZIP</span></span> ]] )</div> <p class='para rdfs-comment'> This function returns a compressed version of the input <i><tt class='parameter'>data</tt></i> compatible with the output of the <strong class='command'>gzip</strong> program. </p> <p class='para'> For more information on the GZIP file format, see the document: <a href='http://www.faqs.org/rfcs/rfc1952' class='link external'>&amp;raquo; GZIP file format specification version 4.3</a> (RFC 1952). </p> </div> <a name='function.gzencode.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The data to encode. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>level</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The level of compression. Can be given as 0 for no compression up to 9 for maximum compression. If not given, the default compression level will be the default compression level of the zlib library. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>encoding_mode</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The encoding mode. Can be <b><tt class='constant'>FORCE_GZIP</tt></b> (the default) or <b><tt class='constant'>FORCE_DEFLATE</tt></b>. </p> <p class='para'> If you use <b><tt class='constant'>FORCE_DEFLATE</tt></b>, you get a standard zlib deflated string (inclusive zlib headers) after the gzip file header but without the trailing crc32 checksum. </p> </dd> </dl> <p> </p> </div> <a name='function.gzencode.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The encoded string, or <b><tt class='constant'>FALSE</tt></b> if an error occurred. </p> </div> <a name='function.gzencode.changelog'></a><div class='refsect1 changelog'> <h3 class='title'>Changelog</h3> <p class='para'> </p><table class='doctable informaltable'> <thead valign='middle'> <tr valign='middle'> <th>Version</th> <th>Description</th> </tr> </thead> <tbody valign='middle' class='tbody'> <tr valign='middle'> <td align='left'>4.2.0</td> <td align='left'> The <i><tt class='parameter'>encoding_mode</tt></i> parameter was added </td> </tr> </tbody> </table> <p> </p> </div> <a name='function.gzencode.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> The resulting data contains the appropriate headers and data structure to make a standard .gz file, e.g.: </p><div class='example'> <p><b>Example #1 Creating a gzip file</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$data&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>implode</span><span style='color: #007700'>(</span><span style='color: #DD0000'>''</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>file</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'bigfile.txt'</span><span style='color: #007700'>));<br /></span><span style='color: #0000BB'>$gzdata&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzencode</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$data</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>9</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>$fp&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>fopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'bigfile.txt.gz'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'w'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>fwrite</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$gzdata</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>fclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$fp</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.gzencode.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.gzdecode.php' class='function' rel='rdfs-seeAlso'>gzdecode()</a> - Decodes a gzip compressed string</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzdeflate.php' class='function' rel='rdfs-seeAlso'>gzdeflate()</a> - Deflate a string</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzinflate.php' class='function' rel='rdfs-seeAlso'>gzinflate()</a> - Inflate a deflated string</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzuncompress.php' class='function' rel='rdfs-seeAlso'>gzuncompress()</a> - Uncompress a compressed string</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzcompress.php' class='function' rel='rdfs-seeAlso'>gzcompress()</a> - Compress a string</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzdeflate" value="<div id='function.gzdeflate' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzdeflate.php'>gzdeflate</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>gzdeflate</span> &amp;mdash; <span class='dc-title'>Deflate a string</span></p> </div> <a name='function.gzdeflate.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>gzdeflate</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$level</tt><span class='initializer'> = -1</span></span> ] )</div> <p class='para rdfs-comment'> This function compress the given string using the <i>DEFLATE</i> data format. </p> <p class='para'> For details on the DEFLATE compression algorithm see the document &amp;quot;<a href='http://www.faqs.org/rfcs/rfc1951' class='link external'>&amp;raquo; DEFLATE Compressed Data Format Specification version 1.3</a>&amp;quot; (RFC 1951). </p> </div> <a name='function.gzdeflate.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The data to deflate. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>level</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The level of compression. Can be given as 0 for no compression up to 9 for maximum compression. If not given, the default compression level will be the default compression level of the zlib library. </p> </dd> </dl> <p> </p> </div> <a name='function.gzdeflate.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The deflated string or <b><tt class='constant'>FALSE</tt></b> if an error occurred. </p> </div> <a name='function.gzdeflate.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>gzdeflate()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$compressed&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzdeflate</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'Compress&amp;nbsp;me'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>9</span><span style='color: #007700'>);<br />echo&amp;nbsp;</span><span style='color: #0000BB'>$compressed</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.gzdeflate.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.gzinflate.php' class='function' rel='rdfs-seeAlso'>gzinflate()</a> - Inflate a deflated string</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzcompress.php' class='function' rel='rdfs-seeAlso'>gzcompress()</a> - Compress a string</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzuncompress.php' class='function' rel='rdfs-seeAlso'>gzuncompress()</a> - Uncompress a compressed string</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzencode.php' class='function' rel='rdfs-seeAlso'>gzencode()</a> - Create a gzip compressed string</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzcompress" value="<div id='function.gzcompress' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzcompress.php'>gzcompress</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.1, PHP 5)</p><p class='refpurpose'><span class='refname'>gzcompress</span> &amp;mdash; <span class='dc-title'>Compress a string</span></p> </div> <a name='function.gzcompress.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>gzcompress</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$level</tt><span class='initializer'> = -1</span></span> ] )</div> <p class='para rdfs-comment'> This function compress the given string using the <i>ZLIB</i> data format. </p> <p class='para'> For details on the ZLIB compression algorithm see the document &amp;quot;<a href='http://www.faqs.org/rfcs/rfc1950' class='link external'>&amp;raquo; ZLIB Compressed Data Format Specification version 3.3</a>&amp;quot; (RFC 1950). </p> <blockquote><p><b class='note'>Note</b>: This is <em class='emphasis'>not</em> the same as gzip compression, which includes some header data. See <a href='http://www.php.net/manual/en/function.gzencode.php' class='function'>gzencode()</a> for gzip compression. <br /> </p></blockquote> </div> <a name='function.gzcompress.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The data to compress. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>level</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The level of compression. Can be given as 0 for no compression up to 9 for maximum compression. </p> </dd> </dl> <p> </p> </div> <a name='function.gzcompress.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The compressed string or <b><tt class='constant'>FALSE</tt></b> if an error occurred. </p> </div> <a name='function.gzcompress.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>gzcompress()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$compressed&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzcompress</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'Compress&amp;nbsp;me'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>9</span><span style='color: #007700'>);<br />echo&amp;nbsp;</span><span style='color: #0000BB'>$compressed</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.gzcompress.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.gzdeflate.php' class='function' rel='rdfs-seeAlso'>gzdeflate()</a> - Deflate a string</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzinflate.php' class='function' rel='rdfs-seeAlso'>gzinflate()</a> - Inflate a deflated string</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzuncompress.php' class='function' rel='rdfs-seeAlso'>gzuncompress()</a> - Uncompress a compressed string</li> <li class='member'><a href='http://www.php.net/manual/en/function.gzencode.php' class='function' rel='rdfs-seeAlso'>gzencode()</a> - Create a gzip compressed string</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="gzclose" value="<div id='function.gzclose' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.gzclose.php'>gzclose</a></h1> <p class='verinfo'>(PHP 4, PHP 5)</p><p class='refpurpose'><span class='refname'>gzclose</span> &amp;mdash; <span class='dc-title'>Close an open gz-file pointer</span></p> </div> <a name='function.gzclose.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><b>gzclose</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$zp</tt></span> )</div> <p class='para rdfs-comment'> Closes the given gz-file pointer. </p> </div> <a name='function.gzclose.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>zp</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The gz-file pointer. It must be valid, and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.gzopen.php' class='function'>gzopen()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.gzclose.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.gzclose.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>gzclose()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$gz&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>gzopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'somefile.gz'</span><span style='color: #007700'>,</span><span style='color: #DD0000'>'w9'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>gzputs&amp;nbsp;</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$gz</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'I&amp;nbsp;was&amp;nbsp;added&amp;nbsp;to&amp;nbsp;somefile.gz'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>gzclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$gz</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.gzclose.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.gzopen.php' class='function' rel='rdfs-seeAlso'>gzopen()</a> - Open gz-file</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="bzwrite" value="<div id='function.bzwrite' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.bzwrite.php'>bzwrite</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>bzwrite</span> &amp;mdash; <span class='dc-title'>Binary safe bzip2 file write</span></p> </div> <a name='function.bzwrite.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>bzwrite</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$bz</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$data</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$length</tt></span> ] )</div> <p class='para rdfs-comment'> <b>bzwrite()</b> writes a string into the given bzip2 file stream. </p> </div> <a name='function.bzwrite.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>bz</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The file pointer. It must be valid and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.bzopen.php' class='function'>bzopen()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>data</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The written data. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>length</tt></i> </span> </dt><dd class='listitem'> <p class='para'> If supplied, writing will stop after <i><tt class='parameter'>length</tt></i> (uncompressed) bytes have been written or the end of <i><tt class='parameter'>data</tt></i> is reached, whichever comes first. </p> </dd> </dl> <p> </p> </div> <a name='function.bzwrite.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the number of bytes written, or <b><tt class='constant'>FALSE</tt></b> on error. </p> </div> <a name='function.bzwrite.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>bzwrite()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$str&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #DD0000'>'uncompressed&amp;nbsp;data'</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>$bz&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>bzopen</span><span style='color: #007700'>(</span><span style='color: #DD0000'>'/tmp/foo.bz2'</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'w'</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>bzwrite</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$bz</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>$str</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>strlen</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$str</span><span style='color: #007700'>));<br /></span><span style='color: #0000BB'>bzclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$bz</span><span style='color: #007700'>);<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.bzwrite.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.bzread.php' class='function' rel='rdfs-seeAlso'>bzread()</a> - Binary safe bzip2 file read</li> <li class='member'><a href='http://www.php.net/manual/en/function.bzopen.php' class='function' rel='rdfs-seeAlso'>bzopen()</a> - Opens a bzip2 compressed file</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="bzread" value="<div id='function.bzread' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.bzread.php'>bzread</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>bzread</span> &amp;mdash; <span class='dc-title'>Binary safe bzip2 file read</span></p> </div> <a name='function.bzread.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>bzread</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$bz</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$length</tt><span class='initializer'> = 1024</span></span> ] )</div> <p class='para rdfs-comment'> <b>bzread()</b> reads from the given bzip2 file pointer. </p> <p class='para'> Reading stops when <i><tt class='parameter'>length</tt></i> (uncompressed) bytes have been read or EOF is reached, whichever comes first. </p> </div> <a name='function.bzread.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>bz</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The file pointer. It must be valid and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.bzopen.php' class='function'>bzopen()</a>. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>length</tt></i> </span> </dt><dd class='listitem'> <p class='para'> If not specified, <b>bzread()</b> will read 1024 (uncompressed) bytes at a time. </p> </dd> </dl> <p> </p> </div> <a name='function.bzread.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the uncompressed data, or <b><tt class='constant'>FALSE</tt></b> on error. </p> </div> <a name='function.bzread.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>bzread()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /><br />$file&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #DD0000'>'/tmp/foo.bz2'</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>$bz&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>bzopen</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$file</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'r'</span><span style='color: #007700'>)&amp;nbsp;or&amp;nbsp;die(</span><span style='color: #DD0000'>'Couldn't&amp;nbsp;open&amp;nbsp;</span><span style='color: #0000BB'>$file</span><span style='color: #DD0000'>'</span><span style='color: #007700'>);<br /><br /></span><span style='color: #0000BB'>$decompressed_file&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #DD0000'>''</span><span style='color: #007700'>;<br />while&amp;nbsp;(!</span><span style='color: #0000BB'>feof</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$bz</span><span style='color: #007700'>))&amp;nbsp;{<br />&amp;nbsp;&amp;nbsp;</span><span style='color: #0000BB'>$decompressed_file&amp;nbsp;</span><span style='color: #007700'>.=&amp;nbsp;</span><span style='color: #0000BB'>bzread</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$bz</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>4096</span><span style='color: #007700'>);<br />}<br /></span><span style='color: #0000BB'>bzclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$bz</span><span style='color: #007700'>);<br /><br />echo&amp;nbsp;</span><span style='color: #DD0000'>'The&amp;nbsp;contents&amp;nbsp;of&amp;nbsp;</span><span style='color: #0000BB'>$file</span><span style='color: #DD0000'>&amp;nbsp;are:&amp;nbsp;&amp;lt;br&amp;nbsp;/&amp;gt;\n'</span><span style='color: #007700'>;<br />echo&amp;nbsp;</span><span style='color: #0000BB'>$decompressed_file</span><span style='color: #007700'>;<br /><br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.bzread.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.bzwrite.php' class='function' rel='rdfs-seeAlso'>bzwrite()</a> - Binary safe bzip2 file write</li> <li class='member'><a href='http://www.php.net/manual/en/function.feof.php' class='function' rel='rdfs-seeAlso'>feof()</a> - Tests for end-of-file on a file pointer</li> <li class='member'><a href='http://www.php.net/manual/en/function.bzopen.php' class='function' rel='rdfs-seeAlso'>bzopen()</a> - Opens a bzip2 compressed file</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="bzopen" value="<div id='function.bzopen' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.bzopen.php'>bzopen</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>bzopen</span> &amp;mdash; <span class='dc-title'>Opens a bzip2 compressed file</span></p> </div> <a name='function.bzopen.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>resource</span> <span class='methodname'><b>bzopen</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$filename</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$mode</tt></span> )</div> <p class='para rdfs-comment'> <b>bzopen()</b> opens a bzip2 (.bz2) file for reading or writing. </p> </div> <a name='function.bzopen.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>filename</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The name of the file to open. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>mode</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Similar to the <a href='http://www.php.net/manual/en/function.fopen.php' class='function'>fopen()</a> function, only &amp;#039;r&amp;#039; (read) and &amp;#039;w&amp;#039; (write) are supported. Everything else will cause bzopen to return <b><tt class='constant'>FALSE</tt></b>. </p> </dd> </dl> <p> </p> </div> <a name='function.bzopen.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> If the open fails, <b>bzopen()</b> returns <b><tt class='constant'>FALSE</tt></b>, otherwise it returns a pointer to the newly opened file. </p> </div> <a name='function.bzopen.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>bzopen()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br /><br />$file&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #DD0000'>'/tmp/foo.bz2'</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>$bz&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>bzopen</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$file</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #DD0000'>'r'</span><span style='color: #007700'>)&amp;nbsp;or&amp;nbsp;die(</span><span style='color: #DD0000'>'Couldn't&amp;nbsp;open&amp;nbsp;</span><span style='color: #0000BB'>$file</span><span style='color: #DD0000'>&amp;nbsp;for&amp;nbsp;reading'</span><span style='color: #007700'>);<br /><br /></span><span style='color: #0000BB'>bzclose</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$bz</span><span style='color: #007700'>);<br /><br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.bzopen.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.bzclose.php' class='function' rel='rdfs-seeAlso'>bzclose()</a> - Close a bzip2 file</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="bzflush" value="<div id='function.bzflush' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.bzflush.php'>bzflush</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>bzflush</span> &amp;mdash; <span class='dc-title'>Force a write of all buffered data</span></p> </div> <a name='function.bzflush.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>bzflush</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$bz</tt></span> )</div> <p class='para rdfs-comment'> Forces a write of all buffered bzip2 data for the file pointer <i><tt class='parameter'>bz</tt></i> . </p> </div> <a name='function.bzflush.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>bz</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The file pointer. It must be valid and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.bzopen.php' class='function'>bzopen()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.bzflush.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.bzflush.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.bzread.php' class='function' rel='rdfs-seeAlso'>bzread()</a> - Binary safe bzip2 file read</li> <li class='member'><a href='http://www.php.net/manual/en/function.bzwrite.php' class='function' rel='rdfs-seeAlso'>bzwrite()</a> - Binary safe bzip2 file write</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="bzerrstr" value="<div id='function.bzerrstr' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.bzerrstr.php'>bzerrstr</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>bzerrstr</span> &amp;mdash; <span class='dc-title'>Returns a bzip2 error string</span></p> </div> <a name='function.bzerrstr.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><b>bzerrstr</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$bz</tt></span> )</div> <p class='para rdfs-comment'> Gets the error string of any bzip2 error returned by the given file pointer. </p> </div> <a name='function.bzerrstr.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>bz</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The file pointer. It must be valid and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.bzopen.php' class='function'>bzopen()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.bzerrstr.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns a string containing the error message. </p> </div> <a name='function.bzerrstr.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.bzerrno.php' class='function' rel='rdfs-seeAlso'>bzerrno()</a> - Returns a bzip2 error number</li> <li class='member'><a href='http://www.php.net/manual/en/function.bzerror.php' class='function' rel='rdfs-seeAlso'>bzerror()</a> - Returns the bzip2 error number and error string in an array</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="bzerror" value="<div id='function.bzerror' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.bzerror.php'>bzerror</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>bzerror</span> &amp;mdash; <span class='dc-title'> Returns the bzip2 error number and error string in an array </span></p> </div> <a name='function.bzerror.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>array</span> <span class='methodname'><b>bzerror</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$bz</tt></span> )</div> <p class='para rdfs-comment'> Returns the error number and error string of any bzip2 error returned by the given file pointer. </p> </div> <a name='function.bzerror.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>bz</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The file pointer. It must be valid and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.bzopen.php' class='function'>bzopen()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.bzerror.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns an associative array, with the error code in the <i>errno</i> entry, and the error message in the <i>errstr</i> entry. </p> </div> <a name='function.bzerror.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 <b>bzerror()</b> example</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$error&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>bzerror</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$bz</span><span style='color: #007700'>);<br /><br />echo&amp;nbsp;</span><span style='color: #0000BB'>$error</span><span style='color: #007700'>[</span><span style='color: #DD0000'>'errno'</span><span style='color: #007700'>];<br />echo&amp;nbsp;</span><span style='color: #0000BB'>$error</span><span style='color: #007700'>[</span><span style='color: #DD0000'>'errstr'</span><span style='color: #007700'>];<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.bzerror.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.bzerrno.php' class='function' rel='rdfs-seeAlso'>bzerrno()</a> - Returns a bzip2 error number</li> <li class='member'><a href='http://www.php.net/manual/en/function.bzerrstr.php' class='function' rel='rdfs-seeAlso'>bzerrstr()</a> - Returns a bzip2 error string</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="bzerrno" value="<div id='function.bzerrno' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.bzerrno.php'>bzerrno</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>bzerrno</span> &amp;mdash; <span class='dc-title'>Returns a bzip2 error number</span></p> </div> <a name='function.bzerrno.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>bzerrno</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$bz</tt></span> )</div> <p class='para rdfs-comment'> Returns the error number of any bzip2 error returned by the given file pointer. </p> </div> <a name='function.bzerrno.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>bz</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The file pointer. It must be valid and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.bzopen.php' class='function'>bzopen()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.bzerrno.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns the error number as an integer. </p> </div> <a name='function.bzerrno.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.bzerror.php' class='function' rel='rdfs-seeAlso'>bzerror()</a> - Returns the bzip2 error number and error string in an array</li> <li class='member'><a href='http://www.php.net/manual/en/function.bzerrstr.php' class='function' rel='rdfs-seeAlso'>bzerrstr()</a> - Returns a bzip2 error string</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="bzdecompress" value="<div id='function.bzdecompress' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.bzdecompress.php'>bzdecompress</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>bzdecompress</span> &amp;mdash; <span class='dc-title'>Decompresses bzip2 encoded data</span></p> </div> <a name='function.bzdecompress.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <span class='methodname'><b>bzdecompress</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$source</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$small</tt><span class='initializer'> = 0</span></span> ] )</div> <p class='para rdfs-comment'> <b>bzdecompress()</b> decompresses the given string containing bzip2 encoded data. </p> </div> <a name='function.bzdecompress.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>source</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The string to decompress. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>small</tt></i> </span> </dt><dd class='listitem'> <p class='para'> If <b><tt class='constant'>TRUE</tt></b>, an alternative decompression algorithm will be used which uses less memory (the maximum memory requirement drops to around 2300K) but works at roughly half the speed. </p> <p class='para'> See the <a href='http://www.bzip.org/' class='link external'>&amp;raquo; bzip2 documentation</a> for more information about this feature. </p> </dd> </dl> <p> </p> </div> <a name='function.bzdecompress.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The decompressed string or number of error in case of error. </p> </div> <a name='function.bzdecompress.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <p class='para'> </p><div class='example'> <p><b>Example #1 Decompressing a String</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$start_str&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #DD0000'>'This&amp;nbsp;is&amp;nbsp;not&amp;nbsp;an&amp;nbsp;honest&amp;nbsp;face?'</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>$bzstr&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>bzcompress</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$start_str</span><span style='color: #007700'>);<br /><br />echo&amp;nbsp;</span><span style='color: #DD0000'>'Compressed&amp;nbsp;String:&amp;nbsp;'</span><span style='color: #007700'>;<br />echo&amp;nbsp;</span><span style='color: #0000BB'>$bzstr</span><span style='color: #007700'>;<br />echo&amp;nbsp;</span><span style='color: #DD0000'>'\n&amp;lt;br&amp;nbsp;/&amp;gt;\n'</span><span style='color: #007700'>;<br /><br /></span><span style='color: #0000BB'>$str&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>bzdecompress</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$bzstr</span><span style='color: #007700'>);<br />echo&amp;nbsp;</span><span style='color: #DD0000'>'Decompressed&amp;nbsp;String:&amp;nbsp;'</span><span style='color: #007700'>;<br />echo&amp;nbsp;</span><span style='color: #0000BB'>$str</span><span style='color: #007700'>;<br />echo&amp;nbsp;</span><span style='color: #DD0000'>'\n&amp;lt;br&amp;nbsp;/&amp;gt;\n'</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div><p> </p> </div> <a name='function.bzdecompress.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.bzcompress.php' class='function' rel='rdfs-seeAlso'>bzcompress()</a> - Compress a string into bzip2 encoded data</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="bzcompress" value="<div id='function.bzcompress' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.bzcompress.php'>bzcompress</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>bzcompress</span> &amp;mdash; <span class='dc-title'>Compress a string into bzip2 encoded data</span></p> </div> <a name='function.bzcompress.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <span class='methodname'><b>bzcompress</b></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$source</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$blocksize</tt><span class='initializer'> = 4</span></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$workfactor</tt><span class='initializer'> = 0</span></span> ]] )</div> <p class='para rdfs-comment'> <b>bzcompress()</b> compresses the given string and returns it as bzip2 encoded data. </p> </div> <a name='function.bzcompress.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>source</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The string to compress. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>blocksize</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Specifies the blocksize used during compression and should be a number from 1 to 9 with 9 giving the best compression, but using more resources to do so. <i><tt class='parameter'>blocksize</tt></i> defaults to 4. </p> </dd> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>workfactor</tt></i> </span> </dt><dd class='listitem'> <p class='para'> Controls how the compression phase behaves when presented with worst case, highly repetitive, input data. The value can be between 0 and 250 with 0 being a special case and the default value. </p> <p class='para'> Regardless of the <i><tt class='parameter'>workfactor</tt></i> , the generated output is the same. </p> </dd> </dl> <p> </p> </div> <a name='function.bzcompress.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> The compressed string or number of error in case of error. </p> </div> <a name='function.bzcompress.examples'></a><div class='refsect1 examples'> <h3 class='title'>Examples</h3> <div class='example'> <p><b>Example #1 Compressing data</b></p> <div class='example-contents programlisting'> <div class='phpcode'><code><span style='color: #000000'> <span style='color: #0000BB'>&amp;lt;?php<br />$str&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #DD0000'>'sample&amp;nbsp;data'</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>$bzstr&amp;nbsp;</span><span style='color: #007700'>=&amp;nbsp;</span><span style='color: #0000BB'>bzcompress</span><span style='color: #007700'>(</span><span style='color: #0000BB'>$str</span><span style='color: #007700'>,&amp;nbsp;</span><span style='color: #0000BB'>9</span><span style='color: #007700'>);<br />echo&amp;nbsp;</span><span style='color: #0000BB'>$bzstr</span><span style='color: #007700'>;<br /></span><span style='color: #0000BB'>?&amp;gt;</span> </span> </code></div> </div> </div> </div> <a name='function.bzcompress.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.bzdecompress.php' class='function' rel='rdfs-seeAlso'>bzdecompress()</a> - Decompresses bzip2 encoded data</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="bzclose" value="<div id='function.bzclose' class='refentry'> <div class='refnamediv'> <h1 class='refname'><a class='info-url' href='http://www.php.net/manual/en/function.bzclose.php'>bzclose</a></h1> <p class='verinfo'>(PHP 4 &amp;gt;= 4.0.4, PHP 5)</p><p class='refpurpose'><span class='refname'>bzclose</span> &amp;mdash; <span class='dc-title'>Close a bzip2 file</span></p> </div> <a name='function.bzclose.description'></a><div class='refsect1 description'> <h3 class='title'>Description</h3> <div class='methodsynopsis dc-description'> <span class='type'>int</span> <span class='methodname'><b>bzclose</b></span> ( <span class='methodparam'><span class='type'>resource</span> <tt class='parameter'>$bz</tt></span> )</div> <p class='para rdfs-comment'> Closes the given bzip2 file pointer. </p> </div> <a name='function.bzclose.parameters'></a><div class='refsect1 parameters'> <h3 class='title'>Parameters</h3> <p class='para'> </p><dl> <dt class='varlistentry'> <span class='term'><i><tt class='parameter'>bz</tt></i> </span> </dt><dd class='listitem'> <p class='para'> The file pointer. It must be valid and must point to a file successfully opened by <a href='http://www.php.net/manual/en/function.bzopen.php' class='function'>bzopen()</a>. </p> </dd> </dl> <p> </p> </div> <a name='function.bzclose.returnvalues'></a><div class='refsect1 returnvalues'> <h3 class='title'>Return Values</h3> <p class='para'> Returns <b><tt class='constant'>TRUE</tt></b> on success or <b><tt class='constant'>FALSE</tt></b> on failure. </p> </div> <a name='function.bzclose.seealso'></a><div class='refsect1 seealso'> <h3 class='title'>See Also</h3> <p class='para'> </p><ul class='simplelist'> <li class='member'><a href='http://www.php.net/manual/en/function.bzopen.php' class='function' rel='rdfs-seeAlso'>bzopen()</a> - Opens a bzip2 compressed file</li> </ul><p> </p> </div> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
<string id="ZipArchive" value="<div> <h1 class='title'><a class='info-url' href='http://www.php.net/manual/en/class.ziparchive.php'>The <a href='http://www.php.net/manual/en/class.ziparchive.php' class='classname'>ZipArchive</a> class</a></h1> <div class='partintro'> <div id='ziparchive.intro' class='section'> <h2 class='title'>Introduction</h2> <p class='para'> A file archive, compressed with Zip. </p> </div> <div id='ziparchive.synopsis' class='section'> <h2 class='title'>Class synopsis</h2> <div class='classsynopsis'> <div class='ooclass'><b class='classname'>ZipArchive</b></div> <div class='classsynopsisinfo'> <span class='ooclass'> <b class='classname'>ZipArchive</b> </span> {</div> <div class='classsynopsisinfo classsynopsisinfo_comment'>/* Properties */</div> <div class='classsynopsisinfo classsynopsisinfo_comment'>/* Methods */</div> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-addemptydir.php' class='function'>addEmptyDir</a></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$dirname</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-addfile.php' class='function'>addFile</a></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$filename</tt></span> [, <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$localname</tt></span> ] )</div> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-addfromstring.php' class='function'>addFromString</a></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$localname</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$contents</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-close.php' class='function'>close</a></span> ( <span class='methodparam'>void</span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-deleteindex.php' class='function'>deleteIndex</a></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$index</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-deletename.php' class='function'>deleteName</a></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$name</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-extractto.php' class='function'>extractTo</a></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$destination</tt></span> [, <span class='methodparam'><span class='type'><a href='http://www.php.net/manual/en/language.pseudo-types.php#language.types.mixed' class='type mixed'>mixed</a></span> <tt class='parameter'>$entries</tt></span> ] )</div> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-getarchivecomment.php' class='function'>getArchiveComment</a></span> ( <span class='methodparam'>void</span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-getcommentindex.php' class='function'>getCommentIndex</a></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$index</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$flags</tt></span> ] )</div> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-getcommentname.php' class='function'>getCommentName</a></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$name</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$flags</tt></span> ] )</div> <div class='methodsynopsis dc-description'> <span class='type'>mixed</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-getfromindex.php' class='function'>getFromIndex</a></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$index</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$flags</tt></span> ] )</div> <div class='methodsynopsis dc-description'> <span class='type'>mixed</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-getfromname.php' class='function'>getFromName</a></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$name</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$flags</tt></span> ] )</div> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-getnameindex.php' class='function'>getNameIndex</a></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$index</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>string</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-getstatusstring.php' class='function'>getStatusString</a></span> ( <span class='methodparam'>void</span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>resource</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-getstream.php' class='function'>getStream</a></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$name</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>mixed</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-locatename.php' class='function'>locateName</a></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$name</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$flags</tt></span> ] )</div> <div class='methodsynopsis dc-description'> <span class='type'>mixed</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-open.php' class='function'>open</a></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$filename</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$flags</tt></span> ] )</div> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-renameindex.php' class='function'>renameIndex</a></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$index</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$newname</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>bool</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-renamename.php' class='function'>renameName</a></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$name</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$newname</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>mixed</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-setarchivecomment.php' class='function'>setArchiveComment</a></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$comment</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>mixed</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-setcommentindex.php' class='function'>setCommentIndex</a></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$index</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$comment</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>mixed</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-setCommentName.php' class='function'>setCommentName</a></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$name</tt></span> , <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$comment</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>mixed</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-statindex.php' class='function'>statIndex</a></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$index</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$flags</tt></span> ] )</div> <div class='methodsynopsis dc-description'> <span class='type'>mixed</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-statname.php' class='function'>statName</a></span> ( <span class='methodparam'><span class='type'><span class='type name'>name</span></span> <tt class='parameter'>$name</tt></span> [, <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$flags</tt></span> ] )</div> <div class='methodsynopsis dc-description'> <span class='type'>mixed</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-unchangeall.php' class='function'>unchangeAll</a></span> ( <span class='methodparam'>void</span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>mixed</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-unchangearchive.php' class='function'>unchangeArchive</a></span> ( <span class='methodparam'>void</span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>mixed</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-unchangeindex.php' class='function'>unchangeIndex</a></span> ( <span class='methodparam'><span class='type'>int</span> <tt class='parameter'>$index</tt></span> )</div> <div class='methodsynopsis dc-description'> <span class='type'>mixed</span> <span class='methodname'><a href='http://www.php.net/manual/en/function.ziparchive-unchangename.php' class='function'>unchangeName</a></span> ( <span class='methodparam'><span class='type'>string</span> <tt class='parameter'>$name</tt></span> )</div> }</div> </div> <div id='ziparchive.props' class='section'> <h2 class='title'>Properties</h2> <dl> <dt id='ziparchive.props.status' class='varlistentry'> <span class='term'><var class='varname'>status</var></span> </dt><dd class='listitem'> <p class='para'>Status of the Zip Archive</p> </dd> <dt id='ziparchive.props.statussys' class='varlistentry'> <span class='term'><var class='varname'>statusSys</var></span> </dt><dd class='listitem'> <p class='para'>System status of the Zip Archive</p> </dd> <dt id='ziparchive.props.numfiles' class='varlistentry'> <span class='term'><var class='varname'>numFiles</var></span> </dt><dd class='listitem'> <p class='para'>Number of files in archive</p> </dd> <dt id='ziparchive.props.filename' class='varlistentry'> <span class='term'><var class='varname'>filename</var></span> </dt><dd class='listitem'> <p class='para'>File name in the file system</p> </dd> <dt id='ziparchive.props.comment' class='varlistentry'> <span class='term'><var class='varname'>comment</var></span> </dt><dd class='listitem'> <p class='para'>Comment for the archive</p> </dd> </dl> </div> </div> <h2>Table of Contents</h2><ul class='chunklist chunklist_reference'><li><a href='http://www.php.net/manual/en/function.ziparchive-addemptydir.php'>ZipArchive::addEmptyDir</a> &amp;acirc;&amp;#128;&amp;#148; Add a new directory</li><li><a href='http://www.php.net/manual/en/function.ziparchive-addfile.php'>ZipArchive::addFile</a> &amp;acirc;&amp;#128;&amp;#148; Adds a file to a ZIP archive from the given path</li><li><a href='http://www.php.net/manual/en/function.ziparchive-addfromstring.php'>ZipArchive::addFromString</a> &amp;acirc;&amp;#128;&amp;#148; Add a file to a ZIP archive using its contents</li><li><a href='http://www.php.net/manual/en/function.ziparchive-close.php'>ZipArchive::close</a> &amp;acirc;&amp;#128;&amp;#148; Close the active archive (opened or newly created)</li><li><a href='http://www.php.net/manual/en/function.ziparchive-deleteindex.php'>ZipArchive::deleteIndex</a> &amp;acirc;&amp;#128;&amp;#148; delete an entry in the archive using its index</li><li><a href='http://www.php.net/manual/en/function.ziparchive-deletename.php'>ZipArchive::deleteName</a> &amp;acirc;&amp;#128;&amp;#148; delete an entry in the archive using its name</li><li><a href='http://www.php.net/manual/en/function.ziparchive-extractto.php'>ZipArchive::extractTo</a> &amp;acirc;&amp;#128;&amp;#148; Extract the archive contents</li><li><a href='http://www.php.net/manual/en/function.ziparchive-getarchivecomment.php'>ZipArchive::getArchiveComment</a> &amp;acirc;&amp;#128;&amp;#148; Returns the Zip archive comment</li><li><a href='http://www.php.net/manual/en/function.ziparchive-getcommentindex.php'>ZipArchive::getCommentIndex</a> &amp;acirc;&amp;#128;&amp;#148; Returns the comment of an entry using the entry index</li><li><a href='http://www.php.net/manual/en/function.ziparchive-getcommentname.php'>ZipArchive::getCommentName</a> &amp;acirc;&amp;#128;&amp;#148; Returns the comment of an entry using the entry name</li><li><a href='http://www.php.net/manual/en/function.ziparchive-getfromindex.php'>ZipArchive::getFromIndex</a> &amp;acirc;&amp;#128;&amp;#148; Returns the entry contents using its index.</li><li><a href='http://www.php.net/manual/en/function.ziparchive-getfromname.php'>ZipArchive::getFromName</a> &amp;acirc;&amp;#128;&amp;#148; Returns the entry contents using its name.</li><li><a href='http://www.php.net/manual/en/function.ziparchive-getnameindex.php'>ZipArchive::getNameIndex</a> &amp;acirc;&amp;#128;&amp;#148; Returns the name of an entry using its index</li><li><a href='http://www.php.net/manual/en/function.ziparchive-getstatusstring.php'>ZipArchive::GetStatusString</a> &amp;acirc;&amp;#128;&amp;#148; Returns the status error message, system and/or zip messages.</li><li><a href='http://www.php.net/manual/en/function.ziparchive-getstream.php'>ZipArchive::getStream</a> &amp;acirc;&amp;#128;&amp;#148; Get a file handler to the entry defined by its name (read only).</li><li><a href='http://www.php.net/manual/en/function.ziparchive-locatename.php'>ZipArchive::locateName</a> &amp;acirc;&amp;#128;&amp;#148; Returns the index of the entry in the archive</li><li><a href='http://www.php.net/manual/en/function.ziparchive-open.php'>ZipArchive::open</a> &amp;acirc;&amp;#128;&amp;#148; Open a ZIP file archive</li><li><a href='http://www.php.net/manual/en/function.ziparchive-renameindex.php'>ZipArchive::renameIndex</a> &amp;acirc;&amp;#128;&amp;#148; Renames an entry defined by its index</li><li><a href='http://www.php.net/manual/en/function.ziparchive-renamename.php'>ZipArchive::renameName</a> &amp;acirc;&amp;#128;&amp;#148; Renames an entry defined by its name</li><li><a href='http://www.php.net/manual/en/function.ziparchive-setarchivecomment.php'>ZipArchive::setArchiveComment</a> &amp;acirc;&amp;#128;&amp;#148; Set the comment of a ZIP archive</li><li><a href='http://www.php.net/manual/en/function.ziparchive-setcommentindex.php'>ZipArchive::setCommentIndex</a> &amp;acirc;&amp;#128;&amp;#148; Set the comment of an entry defined by its index</li><li><a href='http://www.php.net/manual/en/function.ziparchive-setCommentName.php'>ZipArchive::setCommentName</a> &amp;acirc;&amp;#128;&amp;#148; Set the comment of an entry defined by its name</li><li><a href='http://www.php.net/manual/en/function.ziparchive-statindex.php'>ZipArchive::statIndex</a> &amp;acirc;&amp;#128;&amp;#148; Get the details of an entry defined by its index.</li><li><a href='http://www.php.net/manual/en/function.ziparchive-statname.php'>ZipArchive::statName</a> &amp;acirc;&amp;#128;&amp;#148; Get the details of an entry defined by its name.</li><li><a href='http://www.php.net/manual/en/function.ziparchive-unchangeall.php'>ZipArchive::unchangeAll</a> &amp;acirc;&amp;#128;&amp;#148; Undo all changes done in the archive.</li><li><a href='http://www.php.net/manual/en/function.ziparchive-unchangearchive.php'>ZipArchive::unchangeArchive</a> &amp;acirc;&amp;#128;&amp;#148; Revert all global changes done in the archive.</li><li><a href='http://www.php.net/manual/en/function.ziparchive-unchangeindex.php'>ZipArchive::unchangeIndex</a> &amp;acirc;&amp;#128;&amp;#148; Revert all changes done to an entry at the given index.</li><li><a href='http://www.php.net/manual/en/function.ziparchive-unchangename.php'>ZipArchive::unchangeName</a> &amp;acirc;&amp;#128;&amp;#148; Revert all changes done to an entry with the given name.</li></ul> </div><div class='copyright-info'>PHP Documentation is licensed under the <a class='copyright-url' href='http://creativecommons.org/licenses/by/3.0/legalcode'>Creative Commons  Attribution 3.0 License</a>. &copy; 2001-2009 the PHP  Documentation Group.</div> " />
</strings>

