<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>test purposes Archives - WardNet</title>
	<atom:link href="https://www.wardnet.co.uk/tag/test-purposes/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wardnet.co.uk/tag/test-purposes/</link>
	<description>Infrastructure, ERP and General Technology Blog</description>
	<lastBuildDate>Mon, 25 Nov 2013 11:45:53 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://i0.wp.com/www.wardnet.co.uk/wp-content/uploads/2026/01/wp-1767387074640.jpg?fit=32%2C32&#038;ssl=1</url>
	<title>test purposes Archives - WardNet</title>
	<link>https://www.wardnet.co.uk/tag/test-purposes/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">63479081</site>	<item>
		<title>PHP code to list folders in a directory and make them links&#8230;</title>
		<link>https://www.wardnet.co.uk/php-code-to-list-folders-in-a-directory-and-make-them-links/</link>
		
		<dc:creator><![CDATA[Jonathan Ward]]></dc:creator>
		<pubDate>Wed, 28 Aug 2013 11:55:35 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[folders]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[test purposes]]></category>
		<guid isPermaLink="false">http://wardnet.co.uk/?p=248</guid>

					<description><![CDATA[<p>So, I had a vision of listing all the folders within a web directory so that they were browseable &#8211;</p>
<p><a href="https://www.wardnet.co.uk/php-code-to-list-folders-in-a-directory-and-make-them-links/">PHP code to list folders in a directory and make them links&#8230;</a></p>
]]></description>
										<content:encoded><![CDATA[<p>So,</p>
<p>I had a vision of listing all the folders within a web directory so that they were browseable &#8211; I.E if you have a parent site with lots of sub sites, how can you create a list that you can just click on to look at them?</p>
<p>The Solution was a snippet of PHP code I put together based on some useful online stuff, none of which answered the problem specifically, so here it is:</p>
<p><span style="line-height: 19px; font-family: 'courier new', courier; color: #ff0000;">&lt;?php</span></p>
<div><span style="font-family: 'courier new', courier;"><span style="color: #000080;">$dirs</span> <span style="color: #800080;">=</span> <span style="color: #0000ff;">array_filter</span><span style="color: #800080;">(</span><span style="color: #000000;">glo</span>b<span style="color: #800080;">(</span><span style="color: #808080;">&#8216;*&#8217;</span><span style="color: #800080;">)</span>, <span style="color: #808080;">&#8216;is_dir&#8217;</span><span style="color: #800080;">);</span></span></div>
<div><span style="font-family: 'courier new', courier;">asort<span style="color: #800080;">(</span><span style="color: #000080;">$dirs</span><span style="color: #800080;">)</span>;</span></div>
<div><span style="font-family: 'courier new', courier;"><span style="color: #0000ff;">foreach</span> <span style="color: #800080;">(</span><span style="color: #000080;">$dirs</span> <span style="color: #0000ff;">as</span> <span style="color: #000080;">$key</span> <span style="color: #800080;">=&gt;</span> <span style="color: #000080;">$val</span><span style="color: #800080;">) </span><span style="color: #800080;">{</span></span></div>
<div><span style="font-family: 'courier new', courier;">    <span style="color: #0000ff;">echo</span> <span style="color: #808080;">&#8220;&lt;a href=&#8217;$val&#8217;&gt;$val&lt;/a&gt;&lt;br&gt;n&#8221;</span><span style="color: #800080;">;</span></span></div>
<div><span style="font-family: 'courier new', courier; color: #800080;">}</span></div>
<div><span style="font-family: 'courier new', courier;"><span style="color: #ff0000;">?&gt;</span></span></div>
<div></div>
<div></div>
<div>I&#8217;m quite happy with that one!</div>
<div></div>
<div>The usage is at <a title="RedsumoClients Test Area" href="http://www.redsumoclients.co.uk/list.php" target="_blank">http://www.redsumoclients.co.uk/list.php</a> (note: the sites found here are only for development/ test purposes and are not &#8220;live&#8221;)</div>
<p><a href="https://www.wardnet.co.uk/php-code-to-list-folders-in-a-directory-and-make-them-links/">PHP code to list folders in a directory and make them links&#8230;</a></p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">248</post-id>	</item>
	</channel>
</rss>
