Manipulating Breadcrumbs

3 posts by 2 authors in: Forums > CMS Builder
Last Post: July 4, 2012   (RSS)

By Perchpole - July 4, 2012

Hello, All -

I'm trying to do some interesting things with breadcrumbs - using a piece of code I've often used before:

$siblingLineage = preg_replace("/:\d+:$/", ":", $selectedCategory['breadcrumb']);
$siblings = array();
foreach ($categoryRecords as $category) {
if (preg_match("/^$siblingLineage\d+:$/", $category['breadcrumb']) && $category['num'] != $selectedCategory['num']) {
$siblings[] = $category;
}
}


However, do the way in which I intend to use the code I need to remove some of the numbers from the breadcrumb range. For example, if the range was:

1:2:3:4

I need to delete number 3 - which would leave:

1:2:4

How can I do this?

:0/

Perch

Re: [Jason] Manipulating Breadcrumbs

By Perchpole - July 4, 2012

Blimey!

All of that to remove one number!

:os

Perch