$currentURI = JRequest::getURI(); echo "Current URI: " . $currentURI;
$uri = JRequest::getURI(); $parts = parse_url($uri); $packageName = explode('/', $parts['path'])[1]; echo "Package Name: " . $packageName;This code snippet retrieves the current URI and uses the parse_url function to retrieve the path part of the URI. The explode function is then used to split the path into parts and retrieve the package name. The package name is then output to the screen. The package library used in these examples is the Joomla framework.