php-doc-en/reference/rar/examples.xml
Philip Olson fc6c5b9ff8 MFB: Upgrade to the new-reference-structure
- Split reference.xml into book.xml, setup.xml, constants.xml, and examples.xml
- Moved from reference.xml to book.xml:
  - The intro text (partintro), and link to various pages
- Moved from reference.xml to setup.xml:
  - The rest: requirements, installation, configuration, and resources
- Moved from reference.xml to examples.xml:
  - The examples chapter
- Moved from reference.xml to constants.xml:
  - The constants appendix
- Changed the intro ID from <extname>.intro to intro.<extname>


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@248701 c90b9560-bf6c-de11-be94-00142212c4b1
2007-12-21 23:41:39 +00:00

58 lines
1.3 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<chapter xml:id="rar.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<para>
<example>
<title>Rar extension overview example</title>
<programlisting role="php">
<![CDATA[
<?php
$rar_file = rar_open('example.rar') or die("Can't open Rar archive");
$entries = rar_list($rar_file);
foreach ($entries as $entry) {
echo 'Filename: ' . $entry->getName() . "\n";
echo 'Packed size: ' . $entry->getPackedSize() . "\n";
echo 'Unpacked size: ' . $entry->getUnpackedSize() . "\n";
$entry->extract('/dir/extract/to/');
}
rar_close($rar_file);
?>
]]>
</programlisting>
</example>
</para>
<para>
This example opens a Rar file archive and extracts each entry to the
specified directory.
</para>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->