Query: rar_entry_get
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
RAR_ENTRY_GET(3) 1 RAR_ENTRY_GET(3) RarArchive::getEntry - Get entry object from the RAR archive Object oriented style (method):SYNOPSISpublic RarEntry RarArchive::getEntry (string $entryname)DESCRIPTIONProcedural style: RarEntry rar_entry_get (RarArchive $rarfile, string $entryname) Get entry object (file or directory) from the RAR archive. Note You can also get entry objects using RarArchive::getEntries. Note that a RAR archive can have multiple entries with the same name; this method will retrieve only the first.PARAMETERSo $rarfile - A RarArchive object, opened with rar_open(3). o $entryname - Path to the entry within the RAR archive. Note The path must be the same returned by RarEntry::getName.RETURN VALUESReturns the matching RarEntry object or FALSE on failure.EXAMPLESExample #1 Object oriented style <?php $rar_arch = RarArchive::open('solid.rar'); if ($rar_arch === FALSE) die("Could not open RAR archive."); $rar_entry = $rar_arch->getEntry('tese.txt'); if ($rar_entry === FALSE) die("Could get such entry"); echo get_class($rar_entry)." "; echo $rar_entry; $rar_arch->close(); ?> The above example will output something similar to: RarEntry RarEntry for file "tese.txt" (23b93a7a) Example #2 Procedural style <?php $rar_arch = rar_open('solid.rar'); if ($rar_arch === FALSE) die("Could not open RAR archive."); $rar_entry = rar_entry_get($rar_arch, 'tese.txt'); if ($rar_entry === FALSE) die("Could get such entry"); echo get_class($rar_entry)." "; echo $rar_entry; rar_close($rar_arch); ?>SEE ALSORarArchive::getEntries, rar:// wrapper. PHP Documentation Group RAR_ENTRY_GET(3)