// Get the current request URI $uri = JURI::getInstance(); $currentUri = $uri->toString(); echo $currentUri;
// Get the base URL of the website $uri = JURI::getInstance(); $baseUrl = $uri->toString(array('scheme', 'host')); echo $baseUrl;Here, the getInstance function is used to retrieve the base URL of the website by passing an array of the scheme and host to the toString method. Overall, JURI getInstance is a useful function for obtaining the current URL or retrieving specific parts of a URL within the Joomla framework.