this.user Posted November 23, 2010 Share Posted November 23, 2010 if I have www.domain.com/book/?fe23GSd is there a way to get the value fe23GSd that comes after "?"? Link to comment https://forums.phpfreaks.com/topic/219528-getting-value-from-url/ Share on other sites More sharing options...
Pikachu2000 Posted November 23, 2010 Share Posted November 23, 2010 You can explode it on the question mark, or maybe even use parse_url(). Link to comment https://forums.phpfreaks.com/topic/219528-getting-value-from-url/#findComment-1138227 Share on other sites More sharing options...
this.user Posted November 23, 2010 Author Share Posted November 23, 2010 Thanks for directing me in the right direction, this ended up working for me: substr($_SERVER['REQUEST_URI'], strrpos($_SERVER['REQUEST_URI'], '/c/?') + 4); or you can simply do substr($_SERVER['REQUEST_URI'], strrpos($_SERVER['REQUEST_URI'], '?') + 1); Link to comment https://forums.phpfreaks.com/topic/219528-getting-value-from-url/#findComment-1138242 Share on other sites More sharing options...
Pikachu2000 Posted November 23, 2010 Share Posted November 23, 2010 Oh, I thought you had it stored in a variable $_SERVER['QUERY_STRING'] should also hold that value. Link to comment https://forums.phpfreaks.com/topic/219528-getting-value-from-url/#findComment-1138243 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.