kreut Posted March 3, 2011 Share Posted March 3, 2011 Hello, I was wondering if someone could help me to "get" the webaddress of a current webpage and then pull off pieces of the page. All of my pages look like: http://localhost:8888/algebra_book/Chapters/Quadratic_Functions/introductory_problem.php BUT, the stuff to the left of Quadratic Functions WILL change in the future. So all will look like: *Quadratic_Functions/introductory_problem.php Then, I'd like to pull off a $chapter variable, which in this case is Quadratic_Functions and a $page_name variable which in this case will be introductory_problem. Thanks so much. Quote Link to comment https://forums.phpfreaks.com/topic/229483-strings-and-web-pages/ Share on other sites More sharing options...
Muddy_Funster Posted March 3, 2011 Share Posted March 3, 2011 http://php.net/manual/en/reserved.variables.server.php http://www.php.net/manual/en/function.strrpos.php http://php.net/manual/en/function.substr.php combine the info on those three and you will have what you are looking for. Quote Link to comment https://forums.phpfreaks.com/topic/229483-strings-and-web-pages/#findComment-1182319 Share on other sites More sharing options...
kreut Posted March 3, 2011 Author Share Posted March 3, 2011 That'll do it. Thanks so much! Quote Link to comment https://forums.phpfreaks.com/topic/229483-strings-and-web-pages/#findComment-1182330 Share on other sites More sharing options...
Muddy_Funster Posted March 3, 2011 Share Posted March 3, 2011 happy to help, any further problems let us know. Quote Link to comment https://forums.phpfreaks.com/topic/229483-strings-and-web-pages/#findComment-1182370 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.