<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>ziparchive — LowEndSpirit</title>
        <link>https://staging.lowendspirit.com/index.php?p=/</link>
        <pubDate>Sun, 12 Apr 2026 02:18:02 +0000</pubDate>
        <language>en</language>
            <description>ziparchive — LowEndSpirit</description>
    <atom:link href="https://staging.lowendspirit.com/index.php?p=/discussions/tagged/ziparchive/feed.rss" rel="self" type="application/rss+xml"/>
    <item>
        <title>PHP ZipArchive list archive contents</title>
        <link>https://staging.lowendspirit.com/index.php?p=/discussion/5243/php-ziparchive-list-archive-contents</link>
        <pubDate>Wed, 11 Jan 2023 12:53:09 +0000</pubDate>
        <category>Help</category>
        <dc:creator>legendary</dc:creator>
        <guid isPermaLink="false">5243@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>I have wp.zip and would like to list only one level of files/folders. My current code:</p>

<pre><code>$zip = new \ZipArchive();
$zip-&gt;open('wp.zip'), \ZipArchive::RDONLY);

for ($i = 0; $i &lt; $zip-&gt;numFiles; $i++) {
 $stat = $zip-&gt;statIndex($i);
 echo $stat['name'] . ' ';
}
</code></pre>

<p>This code spits out entire list of files recursively.</p>

<p>I need only first level, like this:</p>

<blockquote><div>
  <p>wp-admin/ <br />
  wp-content/ <br />
  index.php <br />
  config.php <br />
  &lt;...&gt;</p>
</div></blockquote>

<p>What's the best approach to achieve my goal?</p>
]]>
        </description>
    </item>
   </channel>
</rss>
