$string = '1,2,3,4,5'; $array = t3lib_div::intExplode(',', $string); print_r($array);
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 )
$string = '1,2,3,4,5'; $array = t3lib_div::intExplode(',', $string, true); print_r($array);
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 )In this example, we are using `intExplode()` with a third parameter set to `true`. This will remove any empty or non-integer values from the resulting array. This function is part of the `t3lib_div` utility class in TYPO3 CMS and is available in the TYPO3 CMS package.