It's preferable to determine if the page is an admin page by checking the active theme, as it provides a comprehensive solution, rather than relying on the URL path. This approach assumes that the admin theme is distinct from the main site theme.
Source code viewer
global $theme; if ($theme === variable_get('admin_theme', 'seven')) { // … }Programming Language: PHP