<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Using Recursive Functions in PHP to Manage Hierarchy</title>
	<link>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/</link>
	<description>PHP/MySQL, REALbasic, Javascript Developer</description>
	<pubDate>Thu, 20 Nov 2008 15:08:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: David Hurst</title>
		<link>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-16153</link>
		<dc:creator>David Hurst</dc:creator>
		<pubDate>Tue, 02 Sep 2008 13:20:39 +0000</pubDate>
		<guid>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-16153</guid>
		<description>Not even a word of thanks. This is why I won't be helping anybody with their code anymore. Very poor show siddiquip.</description>
		<content:encoded><![CDATA[<p>Not even a word of thanks. This is why I won&#8217;t be helping anybody with their code anymore. Very poor show siddiquip.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Hurst</title>
		<link>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15950</link>
		<dc:creator>David Hurst</dc:creator>
		<pubDate>Thu, 28 Aug 2008 13:03:42 +0000</pubDate>
		<guid>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15950</guid>
		<description>So the question really is where in the hierarchy does a particular file sit, and based on this, which direction should you run the function? I'm assuming you want this to be automatic, so you can do away with the File_Type field in your example.

My example above works backwards based on the parent ID, i.e. it checks if the current record has a parent ID greater than 0 and recurses if it does. You could just as easily make a recursive function that runs forwards, however this starts to get a little more complicated, because one of the children, could also have children of it's own. So, whereas working backwards is always straight up, working forwards can end up with a tree like structure.

The simple answer is to have two functions, one that generates the parent lineage, and one that generates the tree of children.

The second function is more difficult and won't work so well with the global array method. However, you could run a simple query to test whether you need to run the function or not. Something like: "SELECT Include_Id FROM FileFiles WHERE Parent_Id='CURRENT_FILE_ID' LIMIT 1

If the above query returns a number greater than zero, then the file has children and the function should be run.

I would then create a global output variable and concatenate each level onto that. Here's a rough outline:

&lt;code&gt;
function findChildren($id) {

&#160;&#160;&#160;global $ob;
&#160;&#160;&#160;$sql = "SELECT ff.Include_Id, f.File_Name FROM FileFiles AS ff LEFT JOIN Files AS f ON ff.Include_Id=f.File_Id WHERE ff.Parent_Id='" . $id . "' ORDER BY f.File_Name ASC";
&#160;&#160;&#160;$rs = mysql_query($sql);
&#160;&#160;&#160;$ob .= "&lt; ul &gt;";
&#160;&#160;&#160;while($data = mysql_fetch_assoc($rs)) {

&#160;&#160;&#160;&#160;&#160;&#160;$ob .= "&lt; li &gt;" . stripslashes(htmlspecialchars($data['File_Name')) . "&lt; /li &gt;";
&#160;&#160;&#160;&#160;&#160;&#160;$children_check = @mysql_result(mysql_query("SELECT Include_Id FROM FileFiles WHERE Parent_Id='" . $data['Include_Id'] . "' LIMIT 1"), 0);
&#160;&#160;&#160;&#160;&#160;&#160;if($children_check) {

&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;findChildren($data['Include_Id']);

&#160;&#160;&#160;&#160;&#160;&#160;}

&#160;&#160;&#160;}

&#160;&#160;&#160;$ob .= "&lt; /ul &gt;";

}
&lt;/code&gt;

I'm writing this code in a comment box, so apologies for any errors (hence the spaces in the HTML tags). What this code should do is create an output buffer ($ob) than can be echoed out to the browser. In this example we create nested unordered lists, and I have used a join in the query so that we can order by file name, or whatever we want. The function will literally spider down every possibility from the top to the bottom.

This sort of recursive function is especially useful for site maps.

I think from this code and the code above you should be able to resolve your issue.

As a quick note, I am happy to help people out, when I have time. I don't always have the time to help. If my code does help you, I would appreciate a credit and a link.

Happy coding!

David</description>
		<content:encoded><![CDATA[<p>So the question really is where in the hierarchy does a particular file sit, and based on this, which direction should you run the function? I&#8217;m assuming you want this to be automatic, so you can do away with the File_Type field in your example.</p>
<p>My example above works backwards based on the parent ID, i.e. it checks if the current record has a parent ID greater than 0 and recurses if it does. You could just as easily make a recursive function that runs forwards, however this starts to get a little more complicated, because one of the children, could also have children of it&#8217;s own. So, whereas working backwards is always straight up, working forwards can end up with a tree like structure.</p>
<p>The simple answer is to have two functions, one that generates the parent lineage, and one that generates the tree of children.</p>
<p>The second function is more difficult and won&#8217;t work so well with the global array method. However, you could run a simple query to test whether you need to run the function or not. Something like: &#8220;SELECT Include_Id FROM FileFiles WHERE Parent_Id=&#8217;CURRENT_FILE_ID&#8217; LIMIT 1</p>
<p>If the above query returns a number greater than zero, then the file has children and the function should be run.</p>
<p>I would then create a global output variable and concatenate each level onto that. Here&#8217;s a rough outline:</p>
<p><code><br />
function findChildren($id) {</code></p>
<p>&nbsp;&nbsp;&nbsp;global $ob;<br />
&nbsp;&nbsp;&nbsp;$sql = &#8220;SELECT ff.Include_Id, f.File_Name FROM FileFiles AS ff LEFT JOIN Files AS f ON ff.Include_Id=f.File_Id WHERE ff.Parent_Id=&#8217;&#8221; . $id . &#8220;&#8216; ORDER BY f.File_Name ASC&#8221;;<br />
&nbsp;&nbsp;&nbsp;$rs = mysql_query($sql);<br />
&nbsp;&nbsp;&nbsp;$ob .= &#8220;< ul >&#8220;;<br />
&nbsp;&nbsp;&nbsp;while($data = mysql_fetch_assoc($rs)) {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ob .= &#8220;< li >&#8221; . stripslashes(htmlspecialchars($data[&#8217;File_Name&#8217;)) . &#8220;< /li >&#8220;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$children_check = @mysql_result(mysql_query(&#8221;SELECT Include_Id FROM FileFiles WHERE Parent_Id=&#8217;&#8221; . $data[&#8217;Include_Id&#8217;] . &#8220;&#8216; LIMIT 1&#8243;), 0);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if($children_check) {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;findChildren($data[&#8217;Include_Id&#8217;]);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;$ob .= &#8220;< /ul >&#8220;;</p>
<p>}<br />
</p>
<p>I&#8217;m writing this code in a comment box, so apologies for any errors (hence the spaces in the HTML tags). What this code should do is create an output buffer ($ob) than can be echoed out to the browser. In this example we create nested unordered lists, and I have used a join in the query so that we can order by file name, or whatever we want. The function will literally spider down every possibility from the top to the bottom.</p>
<p>This sort of recursive function is especially useful for site maps.</p>
<p>I think from this code and the code above you should be able to resolve your issue.</p>
<p>As a quick note, I am happy to help people out, when I have time. I don&#8217;t always have the time to help. If my code does help you, I would appreciate a credit and a link.</p>
<p>Happy coding!</p>
<p>David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: siddiquip</title>
		<link>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15945</link>
		<dc:creator>siddiquip</dc:creator>
		<pubDate>Thu, 28 Aug 2008 11:37:50 +0000</pubDate>
		<guid>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15945</guid>
		<description>Well currently i have this situation ..I have two tables Files,FileFiles their definition are as follows 
CREATE TABLE `FileFiles` (
`Parent_Id` int(11) NOT NULL default '0',
`Include_Id` int(11) NOT NULL default '0',
PRIMARY KEY (`Parent_Id`,`Include_Id`)
) TYPE=InnoDB CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC;

/*Data for the table `FileFiles` */

insert into `FileFiles`(`Parent_Id`,`Include_Id`) values (21,22),(22,23);

/*Table structure for table `Files` */

DROP TABLE IF EXISTS `Files`;

CREATE TABLE `Files` (
`File_Id` int(11) NOT NULL auto_increment,
`File_Type` tinyint(4) NOT NULL default '0',
`File_Name` varchar(255) default NULL,
`File_Version` varchar(255) default NULL,
`File_Info` varchar(255) default NULL,
`File_Server` int(11) default NULL,
`File_Location` varchar(255) default NULL,
PRIMARY KEY (`File_Id`),
UNIQUE KEY `File_Name` (`File_Name`,`File_Server`,`File_Location`)
) TYPE=InnoDB CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC;

/*Data for the table `Files` */

insert into `Files`(`File_Id`,`File_Type`,`File_Name`,`File_Version`,`File_Info`,`File_Ser ver`,`File_Location`) values (1,1,'alcatel_osos_WMRM.props',NULL,NULL,3,'/opt/Omnibus/tsm/solaris2'),(2,1,'alcatel_osos_NZLRM.props',NULL,NULL,3,'/opt/Omnibus/tsm/solaris2'),(3,1,'lucent_g2itm1_sc.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(4,1,'lucent_g2itm2_sc.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(5,1,'mv36_ZEM1.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(6,1,'mv36_ZEM2.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(7,1,'mv36_ZEM3.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(8,1,'mv36_ZEM4.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(9,1,'mv36_NWAEM1.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(10,1,'mv36_NWAEM2.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(11,1,'mv36_NWAEM3.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(12,1,'mv36_NWBEM1.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(13,1,'mv36_NWBEM2.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(14,1,'mv36_NWBEM3.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(15,1,'mv36_NOEM1.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(16,1,'mv36_NOEM2.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(17,1,'mv36_NOEM3.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(18,1,'mv36_MEM1.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(19,1,'mv36_MEM2.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(20,1,'mv36_MEM3.props',NULL,NULL,3,'/opt/Omnibus/probes/solaris2'),(21,2,'mttrapd.rules',NULL,NULL,3,NULL),(22,3,'mttrapd.include.rule s',NULL,NULL,3,NULL),(23,4,'mttrapd.lookup',NULL,NULL,3,NULL),(24,2,'huwaei.ru les',NULL,NULL,3,NULL),(25,2,'mm.rules',NULL,NULL,3,NULL);
The FileFiles table is a link table that links to the Files Table

Now i wish to create a page in php to access all the files (which i managed to create) but it should also show the files which it includes in hierarchy  
eg if my FileFiles table is like this 
                       parent_id    include_id
                        21               22 
                        22               23 
                        22               24
so when a user wants to find a relation for  file 21 we should be shown as follows 
21-&#62;22-&#62;23
        -&#62;24
or if i want info about file 24 then it should show                        
21&#60;-2223
for all in hierarchy .The only way that can be achieved is by using File_Type field in Files Table 
such that if type =2 the file will have hieracrhy lower down the order(ie childs)
                  type =3 will have both parents and childs
                   type = 4 will have only parents and no childs 
therefore i need to implement a recursion based upon a field in another table  withould having 
knowledge about the depth (which can be more that 20 levels in both direction)
any hint about how this can be achieved?
Thanks</description>
		<content:encoded><![CDATA[<p>Well currently i have this situation ..I have two tables Files,FileFiles their definition are as follows<br />
CREATE TABLE `FileFiles` (<br />
`Parent_Id` int(11) NOT NULL default &#8216;0&#8242;,<br />
`Include_Id` int(11) NOT NULL default &#8216;0&#8242;,<br />
PRIMARY KEY (`Parent_Id`,`Include_Id`)<br />
) TYPE=InnoDB CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC;</p>
<p>/*Data for the table `FileFiles` */</p>
<p>insert into `FileFiles`(`Parent_Id`,`Include_Id`) values (21,22),(22,23);</p>
<p>/*Table structure for table `Files` */</p>
<p>DROP TABLE IF EXISTS `Files`;</p>
<p>CREATE TABLE `Files` (<br />
`File_Id` int(11) NOT NULL auto_increment,<br />
`File_Type` tinyint(4) NOT NULL default &#8216;0&#8242;,<br />
`File_Name` varchar(255) default NULL,<br />
`File_Version` varchar(255) default NULL,<br />
`File_Info` varchar(255) default NULL,<br />
`File_Server` int(11) default NULL,<br />
`File_Location` varchar(255) default NULL,<br />
PRIMARY KEY (`File_Id`),<br />
UNIQUE KEY `File_Name` (`File_Name`,`File_Server`,`File_Location`)<br />
) TYPE=InnoDB CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC;</p>
<p>/*Data for the table `Files` */</p>
<p>insert into `Files`(`File_Id`,`File_Type`,`File_Name`,`File_Version`,`File_Info`,`File_Ser ver`,`File_Location`) values (1,1,&#8217;alcatel_osos_WMRM.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/tsm/solaris2&#8242;),(2,1,&#8217;alcatel_osos_NZLRM.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/tsm/solaris2&#8242;),(3,1,&#8217;lucent_g2itm1_sc.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(4,1,&#8217;lucent_g2itm2_sc.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(5,1,&#8217;mv36_ZEM1.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(6,1,&#8217;mv36_ZEM2.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(7,1,&#8217;mv36_ZEM3.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(8,1,&#8217;mv36_ZEM4.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(9,1,&#8217;mv36_NWAEM1.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(10,1,&#8217;mv36_NWAEM2.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(11,1,&#8217;mv36_NWAEM3.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(12,1,&#8217;mv36_NWBEM1.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(13,1,&#8217;mv36_NWBEM2.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(14,1,&#8217;mv36_NWBEM3.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(15,1,&#8217;mv36_NOEM1.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(16,1,&#8217;mv36_NOEM2.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(17,1,&#8217;mv36_NOEM3.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(18,1,&#8217;mv36_MEM1.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(19,1,&#8217;mv36_MEM2.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(20,1,&#8217;mv36_MEM3.props&#8217;,NULL,NULL,3,&#8217;/opt/Omnibus/probes/solaris2&#8242;),(21,2,&#8217;mttrapd.rules&#8217;,NULL,NULL,3,NULL),(22,3,&#8217;mttrapd.include.rule s&#8217;,NULL,NULL,3,NULL),(23,4,&#8217;mttrapd.lookup&#8217;,NULL,NULL,3,NULL),(24,2,&#8217;huwaei.ru les&#8217;,NULL,NULL,3,NULL),(25,2,&#8217;mm.rules&#8217;,NULL,NULL,3,NULL);<br />
The FileFiles table is a link table that links to the Files Table</p>
<p>Now i wish to create a page in php to access all the files (which i managed to create) but it should also show the files which it includes in hierarchy<br />
eg if my FileFiles table is like this<br />
                       parent_id    include_id<br />
                        21               22<br />
                        22               23<br />
                        22               24<br />
so when a user wants to find a relation for  file 21 we should be shown as follows<br />
21-&gt;22-&gt;23<br />
        -&gt;24<br />
or if i want info about file 24 then it should show<br />
21&lt;-2223<br />
for all in hierarchy .The only way that can be achieved is by using File_Type field in Files Table<br />
such that if type =2 the file will have hieracrhy lower down the order(ie childs)<br />
                  type =3 will have both parents and childs<br />
                   type = 4 will have only parents and no childs<br />
therefore i need to implement a recursion based upon a field in another table  withould having<br />
knowledge about the depth (which can be more that 20 levels in both direction)<br />
any hint about how this can be achieved?<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Hurst</title>
		<link>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15941</link>
		<dc:creator>David Hurst</dc:creator>
		<pubDate>Thu, 28 Aug 2008 10:04:38 +0000</pubDate>
		<guid>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15941</guid>
		<description>Siddiquip,

I'd need more info to give a meaningful answer on that one.

David</description>
		<content:encoded><![CDATA[<p>Siddiquip,</p>
<p>I&#8217;d need more info to give a meaningful answer on that one.</p>
<p>David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: siddiquip</title>
		<link>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15940</link>
		<dc:creator>siddiquip</dc:creator>
		<pubDate>Thu, 28 Aug 2008 09:24:36 +0000</pubDate>
		<guid>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15940</guid>
		<description>great work by u .............
but i have a question how do we achieve recursion based upon values from two tables where value in one of the table is recursive  to show a tree like structure</description>
		<content:encoded><![CDATA[<p>great work by u &#8230;&#8230;&#8230;&#8230;.<br />
but i have a question how do we achieve recursion based upon values from two tables where value in one of the table is recursive  to show a tree like structure</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Hurst</title>
		<link>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15625</link>
		<dc:creator>David Hurst</dc:creator>
		<pubDate>Wed, 20 Aug 2008 16:35:33 +0000</pubDate>
		<guid>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15625</guid>
		<description>Thanks DMark - I've restored the closing tag. Wordpress is pretty crap for stripping stuff out when you don't want it to!

There are many ways to solve your problem, the easiest (and least elegant) would be to simply store the URL string in the database too. Off the top of my head, I would probably tackle it by adding an extra field to the database for URL name, in which you can put 'computing', 'linux' or whatever it needs to be. (You could perform a variety of functions to turn the main name into the URL and do away with this extra field, but that won't work well for long names.)

You will need another global variable to handle the URL string and you will need two more functions. The first function will be a handler that reverse sorts the array, adds the .htm on the end and returns it two the first function. Before it does that, the handler will call another recursive function that works backwards through the database in the same way as the first recursive function to build the array of URL names.

I'm sure there is a way to do it all in the one function, but I don't have the time to sit down and figure it out, and after a day of coding, my brain is just not accepting new challenges! Anyway, this method will work, and though on the face of it, it looks like it might be a bit resource hungry, it really isn't and will run perfectly quickly.</description>
		<content:encoded><![CDATA[<p>Thanks DMark - I&#8217;ve restored the closing tag. Wordpress is pretty crap for stripping stuff out when you don&#8217;t want it to!</p>
<p>There are many ways to solve your problem, the easiest (and least elegant) would be to simply store the URL string in the database too. Off the top of my head, I would probably tackle it by adding an extra field to the database for URL name, in which you can put &#8216;computing&#8217;, &#8216;linux&#8217; or whatever it needs to be. (You could perform a variety of functions to turn the main name into the URL and do away with this extra field, but that won&#8217;t work well for long names.)</p>
<p>You will need another global variable to handle the URL string and you will need two more functions. The first function will be a handler that reverse sorts the array, adds the .htm on the end and returns it two the first function. Before it does that, the handler will call another recursive function that works backwards through the database in the same way as the first recursive function to build the array of URL names.</p>
<p>I&#8217;m sure there is a way to do it all in the one function, but I don&#8217;t have the time to sit down and figure it out, and after a day of coding, my brain is just not accepting new challenges! Anyway, this method will work, and though on the face of it, it looks like it might be a bit resource hungry, it really isn&#8217;t and will run perfectly quickly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DMark</title>
		<link>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15611</link>
		<dc:creator>DMark</dc:creator>
		<pubDate>Wed, 20 Aug 2008 06:33:58 +0000</pubDate>
		<guid>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15611</guid>
		<description>David
Great code. One point I noticed - the closing anchor tag seems to have gone missing. 

My question is, however, how can I code your program so the anchor tags of each link are the aggregation of the previous link components?
Example: With the breadcrumb trail  'Interests &#62; Computing &#62; Linux' I want the 'Linux' anchor tag to read 'a href="/interests/computing/linux.htm"' and the 'Computing' anchor tag to read 'a href="/interests/computing.htm"'

Very much appreciate your insight into this.</description>
		<content:encoded><![CDATA[<p>David<br />
Great code. One point I noticed - the closing anchor tag seems to have gone missing. </p>
<p>My question is, however, how can I code your program so the anchor tags of each link are the aggregation of the previous link components?<br />
Example: With the breadcrumb trail  &#8216;Interests &gt; Computing &gt; Linux&#8217; I want the &#8216;Linux&#8217; anchor tag to read &#8216;a href=&#8221;/interests/computing/linux.htm&#8221;&#8216; and the &#8216;Computing&#8217; anchor tag to read &#8216;a href=&#8221;/interests/computing.htm&#8221;&#8216;</p>
<p>Very much appreciate your insight into this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: M.D. Charan</title>
		<link>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15147</link>
		<dc:creator>M.D. Charan</dc:creator>
		<pubDate>Sat, 26 Jul 2008 04:42:05 +0000</pubDate>
		<guid>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15147</guid>
		<description>thanks a lot

its works for me</description>
		<content:encoded><![CDATA[<p>thanks a lot</p>
<p>its works for me</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Hurst</title>
		<link>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15040</link>
		<dc:creator>David Hurst</dc:creator>
		<pubDate>Mon, 21 Jul 2008 09:28:42 +0000</pubDate>
		<guid>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15040</guid>
		<description>Lucky,

I don't know if something can be "too recursive" - it's either recursive or it isn't. However, this script has nothing to do with opening files, and this sounds more like a server configuration error to me. If you can email me the link to the page and attach the source code you are using, I'll take a look for you.

Cheers,

David</description>
		<content:encoded><![CDATA[<p>Lucky,</p>
<p>I don&#8217;t know if something can be &#8220;too recursive&#8221; - it&#8217;s either recursive or it isn&#8217;t. However, this script has nothing to do with opening files, and this sounds more like a server configuration error to me. If you can email me the link to the page and attach the source code you are using, I&#8217;ll take a look for you.</p>
<p>Cheers,</p>
<p>David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luckylinux</title>
		<link>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15000</link>
		<dc:creator>Luckylinux</dc:creator>
		<pubDate>Fri, 18 Jul 2008 14:14:08 +0000</pubDate>
		<guid>http://www.davidhurst.co.uk/2006/10/13/using-recursive-functions-in-php-to-manage-hierarchy/#comment-15000</guid>
		<description>Sorry to disturb you, but isn't maybe this a bit too recursive.
It seems to work OK (it takes some time), but to me it asks to download an empty file named *.php (the 
script's name).
Can you give me some suggestion please ?
It's very very strange.
Thanks
Luckylinux</description>
		<content:encoded><![CDATA[<p>Sorry to disturb you, but isn&#8217;t maybe this a bit too recursive.<br />
It seems to work OK (it takes some time), but to me it asks to download an empty file named *.php (the<br />
script&#8217;s name).<br />
Can you give me some suggestion please ?<br />
It&#8217;s very very strange.<br />
Thanks<br />
Luckylinux</p>
]]></content:encoded>
	</item>
</channel>
</rss>
