This could be a useful function for using specific banner images in different sections of a website. For example, if there is a JPG image which correspsonds to the each top-level page in the site (like “produce”, above), it could be included this way:
//find the top-level page slug, and save it to a variable, e.g. $topSlug, then
<img src="<?phpecho(url_start_with($topSlug)) ? $topSlug:'default';?>.jpg" />
This banner would then be used for all the child-pages (e.g. “fruit” and “apples” in the example above) for that top page.