$juri = JUri::getInstance(); if ($juri->isInternal()) { echo "This is an internal URL"; } else { echo "This is an external URL"; }
$url = "https://www.example.com"; $juri = JUri::getInstance($url); if ($juri->isInternal()) { echo "This is an internal URL"; } else { echo "This is an external URL"; }In both examples, the isInternal method is called on an instance of the JUri class. The first example checks if the current page URL is internal or external, while the second example checks a given URL. The JUri class is part of the Joomla CMS framework.