document.write('<div class="php" style="font-family: monospace;"><br />');
document.write('<span style="color: #808080; font-style: italic;">//------------------------------------------------------------------------------------------------------</span><br />');
document.write('<span style="color: #808080; font-style: italic;">//GetFilesFolders($Path)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FUNCTION</span><br />');
document.write('<span style="color: #808080; font-style: italic;">//------------------------------------------------------------------------------------------------------</span><br />');
document.write('<span style="color: #808080; font-style: italic;">//&nbsp; &nbsp; &nbsp; What it does-</span><br />');
document.write('<span style="color: #808080; font-style: italic;">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Get\'s all file/folder names in $Path</span><br />');
document.write('<span style="color: #808080; font-style: italic;">//</span><br />');
document.write('<span style="color: #808080; font-style: italic;">//&nbsp; &nbsp; &nbsp; Changes - </span><br />');
document.write('<span style="color: #808080; font-style: italic;">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; August 2nd, 2006 - RaX - Created. </span><br />');
document.write('<span style="color: #808080; font-style: italic;">//</span><br />');
document.write('<span style="color: #808080; font-style: italic;">//------------------------------------------------------------------------------------------------------</span><br />');
document.write('<span style="color: #000000; font-weight: bold;">function</span> GetFilesFolders<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$Path</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$Index</span> = <span style="color: #cc66cc;">0</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$handle</span> = <a target="_blank"&nbsp; href="http://www.php.net/opendir"><span style="color: #000066;">opendir</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$Path</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">false</span> !== <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$file</span> = <a target="_blank"&nbsp; href="http://www.php.net/readdir"><span style="color: #000066;">readdir</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$handle</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$file</span> != <span style="color: #ff0000;">&quot;..&quot;</span> &amp;&amp; <span style="color: #0000ff;">$file</span> != <span style="color: #ff0000;">&quot;.&quot;</span> &amp;&amp; <span style="color: #0000ff;">$file</span> != <span style="color: #ff0000;">\'index.php\'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$Result</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$Index</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #0000ff;">$file</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$Index</span>++;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$Result</span>;<br />');
document.write('<span style="color: #66cc66;">&#125;</span><br />');
document.write('&nbsp;</div>');
document.write('<br />&nbsp;<br /><div style="font-size: 12px">Brought to you by the community at <a href="http://www.bytemycode.com/snippets/snippet/380/1/" target="_blank">byteMyCode</a>.</div>');
