// Convert version string to integer $versionString = '1.2.3'; $versionInt = t3lib_div::int_from_ver($versionString); // Print the result echo $versionInt;
// Compare two version strings $version1 = '1.2.3'; $version2 = '1.2.4'; if (t3lib_div::int_from_ver($version1) < t3lib_div::int_from_ver($version2)) { echo 'Version 2 is newer than version 1'; } else { echo 'Version 1 is newer than version 2'; }In this example, we're comparing two version strings using int_from_ver. We're using the resulting integer values to determine which version is newer. Overall, t3lib_div is a powerful package library in TYPO3 CMS that contains many useful utility functions, including int_from_ver.