SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Chepstow, South Wales
    Posts
    915
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Grab everything in URL after first slash

    We are in the process of building a german website to accompany our english website, and basically we wont the user to be able to click a flag on any page and the user will go to the indentical page on the other website, its all set up ready to go but i cant work out how to grab everything after the .com or .co.uk so I can paste it onto the other domain name to use as a link in the flag.

    So this is just one example of a string.


    http://devchecksafetyfirstde.csf.dcm....cPAh6Iez.dpbs


    So the bit I want always is everythng after - http://devchecksafetyfirstde.csf.dcmanaged.com

    Which in this case is - /hotel.php?hotel_ID=247007&Type=3&Resort=363#sthash.JFxlzIxA.cPAh6Iez.dpbs

    Thanks

  2. #2
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Chepstow, South Wales
    Posts
    915
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry all,

    I think I got it now, using:

    $actual_link = "$_SERVER[REQUEST_URI]";

    echo'd it out and got exactly what I need


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •