$path = '/var/www/html/index.php'; if (GeneralUtility::isAbsPath($path)) { echo "Path is absolute"; } else { echo "Path is relative"; }
$path = '../images/logo.png'; if (GeneralUtility::isAbsPath($path)) { echo "Path is absolute"; } else { echo "Path is relative"; }Output: Path is relative In both examples, the isAbsPath function is called with the path as the argument. The function returns true if the path is absolute and false if it is relative. The TYPO3 CMS core utility package is part of the TYPO3 CMS core and can be found in the TYPO3\CMS\Core\Utility namespace.