Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

read out last breadcrumb 'object'


dahui

Recommended Posts

Posted

hi

 

echo $breadcrumb->trail(' » ');

 

will display the whole breadcrumbstring

 

I would like to cut this down to allways display only the last 'object'

 

like

Start ? Pflege ? Augenpfelge ? Glucan Eye Serum
returns "Glucan Eye Serum"

or

Start ? Pflege ? Augenpfelge
returns "Augenpflege"

or

Start
returns "Start"

 

anybody can gimme a hand on this???

 

dahui

Posted

Hi mike, use explode() to break down the string to an array

$new_trail_str = $breadcrumb->trail(' » ');
$new_trail_array = explode('»', $new_trail_str);
$last_string = $new_trail_array[count($new_trail_array)-1];
echo $last_string;

Posted

perfect! that does exactly the job ;) (I did not expect else)

 

thx Mark very nice of you (as usual)

 

dahui

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...