Benutzer: Gast
Eintrag: Extbase: static explode methods

Extbase: static explode methods

von: marcel
Tags: Extbase, PHP, Typo3
Kreise: Typo3
Code: PHP
/**
 * Explodes a $string delimited by $delimeter and passes each item in the array through intval().
 * Corresponds to explode(), but with conversion to integers for all values.
 *
 * @param string $delimiter Delimiter string to explode with
 * @param string $string The string to explode
 * @return array Exploded values, all converted to integers
 */
$array = \TYPO3\CMS\Extbase\Utility\ArrayUtility::integerExplode($delimiter, $string);


/**
 * Explodes a string and trims all values for whitespace in the ends.
 * If $onlyNonEmptyValues is set, then all blank ('') values are removed.
 *
 * @param string $delimiter Delimiter string to explode with
 * @param string $string The string to explode
 * @param boolean $onlyNonEmptyValues If set, all empty values (='') will NOT be set in output
 * @return array Exploded values
 */
$array = \TYPO3\CMS\Extbase\Utility\ArrayUtility::trimExplode($delimiter, $string, $onlyNonEmptyValues) ;
Es gibt noch keine Kommentare.