<?php
function getBreadcrumb($sPath,$bolLastLink=false,$sPrePath='',$cDelimOut='/',$cDelimInput='/'){$out='';$path=trim(trim($sPath,$cDelimInput));$ar=explode($cDelimInput,$path);$step=0;$lnk=$sPrePath; foreach($ar as$s){$step++;$txt=htmlspecialchars($s);$lnk.='/'.rawurlencode($s);if($bolLastLink or count($ar)>$step){$out.=$cDelimOut.'<a href="'.$lnk.'">'.$txt.'</a>';}else{$out.=$cDelimOut.$txt;}}$s=array();$s=array();$s[]='\\';$r[]='\\\\';$s[]='/';$r[]='\/';$s[]='?';$r[]='\?';$s[]='+';$r[]='\+';$s[]='*';$r[]='\*';$s[]='.';$r[]='\.';$s[]='(';$r[]='\(';$s[]=')';$r[]='\)';$s[]='[';$r[]='\[';$s[]=']';$r[]='\]';$s[]='{';$r[]='\{';$s[]='}';$r[]='\}';return preg_replace('/^'.str_replace($s,$r,$cDelimOut).'/','',$out);}