$ip1 = '192.168.0.1'; $ip2 = '192.168.0.2'; if (GeneralUtility::cmpIP($ip1, $ip2)) { echo 'The IP addresses are equal.'; } else { echo 'The IP addresses are not equal.'; }
$packageKey = 'my_extension'; $library = GeneralUtility::underscoredToUpperCamelCase($packageKey) . '\Library'; if (class_exists($library)) { echo 'The library for this extension exists.'; } else { echo 'The library for this extension does not exist.'; }In this example, we use GeneralUtility to determine if the library for a specific Typo3 extension exists or not. We first convert the extension key to camel case format and append "\Library" to it to get the name of the library class. We then check if the class exists or not.