Hi, can someone tell me how to check a path and return TRUE if it matches? For example, checking if the path == domain.com/user
Additionally, can I add a wildcard to it? like domain.com/user/*?
Thanks!
barns101
3:52 pm on Sep 5, 2006 (gmt 0)
By "path" do you mean URL? The URL can be accessed by using $_SERVER['HTTP_HOST'] and $_SERVER['REQUEST_URI'] together. Then you could check for the instance of a string with strpos() [php.net] or preg_match() [php.net] if you want to use regular expressions.
sodani
6:53 pm on Sep 5, 2006 (gmt 0)
Yes, the URL. I have some paths (domain.com/myaccount, domain.com/user) and I want to check if the current page is "myaccount" and if it is, then print something. I just need a function that will out put a T or F depending on whether the current path is the one I specified.