/ Published in: PHP

This method will use the request)uri to create breadcrumbs
add this where you what crumb to show up echo breadcrumbs();
add this where you what crumb to show up echo breadcrumbs();
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function breadcrumbs($separator = ' / ', $home = 'Home') { $base_url = ($_SERVER['HTTPS'] ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/'; foreach ($path AS $x => $crumb) { if ($x != $last){ $breadcrumbs[] = '<a href="$base_url$crumb">$title</a>'; }else{ $breadcrumbs[] = $title; } } }
Comments
