Well couldn't you take the common information out and put them at the top and bottom like:
<?php
echo "<div id=\"menu_large\">\n";
echo "<ul>\n";
if(strstr($link,'oceandots') && (isset($sub))){
gmv_menu();
echo "<li><a href=\"$link\">$place</a> > </li>\n";
echo "<li>location map</li>\n";
}
elseif (strstr($link,'oceandots') && (is_null($sub))){
gmv_menu();
echo "<li>location map</li>\n";
}
elseif(strstr($link,'oceandots') === false && (isset($sub))){
echo "<li>$place ></li>\n";
echo "<li>location map</li>\n";
}
elseif(strstr($link,'oceandots') === false && (is_null($sub))){
echo "<li>$place ></li>\n";
echo "<li>location map</li>\n";
}
echo "</ul>\n";
echo "</div>\n";
echo "</div>\n";
?>
But this is assuming one of the conditions is always met whatever happens?
Also your last 2 cases output the same so could you not combine them like:
<?php
echo "<div id=\"menu_large\">\n";
echo "<ul>\n";
if(strstr($link,'oceandots') && (isset($sub))){
gmv_menu();
echo "<li><a href=\"$link\">$place</a> > </li>\n";
echo "<li>location map</li>\n";
}
elseif (strstr($link,'oceandots') && (is_null($sub))){
gmv_menu();
echo "<li>location map</li>\n";
}
elseif(strstr($link,'oceandots') === false && ((isset($sub)) || (is_null($sub)) ){
echo "<li>$place ></li>\n";
echo "<li>location map</li>\n";
}
echo "</ul>\n";
echo "</div>\n";
echo "</div>\n";
?>
That shortens the exisiting code, but as for the logic I have a feeling it could probably be a bit better. How exactly does this breadcrumb menu work? Why would you be displaying navigation based on the refferer anyhow, unless it was a back button?
Why not just display the breadcrumb as it is in your site regardless of where the user has come from?
e.g check out the breadcrumb for this particular topic on this site:
It will always be this regardless of the refferer.