kee2ka4 Posted August 17, 2008 Share Posted August 17, 2008 Hi everyone, I want to collect two elements of the URL in a array that is, 1. the domain prefix after the domain name and 2. the name of the first subfolder. So for example if I have the domain name: www.sitename.co.uk/student, I want the collect the co.uk and student in a array. And for example if I have the domain name: www.sitename.com/teacher, in this case I want to collect com and teacher in a array. How can I implement this. Thanks, Ket Link to comment https://forums.phpfreaks.com/topic/120063-need-help-to-collect-certain-elements-of-a-url-in-an-array/ Share on other sites More sharing options...
trq Posted August 17, 2008 Share Posted August 17, 2008 Take a look at parse_url() and explode() Link to comment https://forums.phpfreaks.com/topic/120063-need-help-to-collect-certain-elements-of-a-url-in-an-array/#findComment-618498 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.