I am trying to use URL rewriting on my website, and I want to use functions list()and explode()to get the right content. Currently my code is as follows:
list($dir, $act) = explode('/',$url);
In this case, it $urlis equal to everything after the first slash in the absolute URL, i.e. http://example.com/random/stuff => $url = random/stuff/this will work fine, but if I want to go to http://example.com/random/, then it will print a notification on the page. How to turn off the notification, do I need to use something different from the function list()?
Currently the notification is "Notification: Undefined offset: 1 ..."
Thanks for the help!
source
share