Jump to content

Picking a section of url


louisstephens
 Share

Recommended Posts

Ill try to explain this as best I can. I am making a site map and using the following:

foreach($page->sitemap as $site) {
    $out = "\n<url>";
    $out .= "\n\t<loc>" . $site->httpUrl . "</loc>";
    $out .= "\n\t<lastmod>" . date("Y-m-d", $page->modified) . "</lastmod>";
    $out .= "\n</url>";

    echo $out;

    }

This works perfectly and the url displays as http://sitename.com/data/datasetone/page-one . I was wondering for the sake of this question, is there a way to only pull from /page-one in the url? I know $site->url would give me data/datasetone/page-one, but I really need just the page name

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...