$list = 'apple, banana, cherry'; $array = t3lib_div::trimExplode(',', $list); // $array is now ['apple', 'banana', 'cherry']
$list = 'foo: bar: baz'; $array = t3lib_div::trimExplode(':', $list); // $array is now ['foo', 'bar', 'baz']
$list = 'foo bar baz'; $array = t3lib_div::trimExplode(' ', $list); // $array is now ['foo', 'bar', 'baz']These examples show how the trimExplode function can be used to split a string into an array and trim each element. It is a part of the TYPO3 CMS package library.