Bread navigation problems. For example, if you want to post an article that belongs to the B class. A message is automatically inserted into the database.
When I look up my article, how can I display the breadcrumb navigation on the page. As shown in the following figure, I am a newbie and I don't know much about it. please give me some advice ..
Home> A category> B category
Reply to discussion (solution)
/* Select catid, upid, catname from the array $ a that reads the execution ratio of the classification table. Is such an array */$ a = array ('catid' => 1, 'upid '=> 0, 'catname' => 'A classifier '), array ('catid' => 2, 'upid '=> 1, 'catname' =>' B category'),); $ a = find_parent ($, 'catid', 'upid '); $ res = array (); $ p = & $ a [2]; // The category of the current article while ($ p) {array_unshift ($ res, $ p ['catname']); if (! Isset ($ p ['parent']) break; $ p = & $ p ['parent'] [$ p ['upid '];} echo join ('>', $ res );
Function find_parent see http://bbs.csdn.net/topics/370094009