I am receiving the php error “undefined offset: 1” when the URL is domain.com/portfolio but not for domain.com/portfolio/project1. Many thanks in advance
$path = drupal_get_path_alias($_GET['q']);
$path = explode('/', $path);
if ($path[0] == 'portfolio' && $path[1] != '') {
// action
}
1 Answer