[TYPO3-mvc] Fluid ViewHelper Incubator

Martin Kutschker masi-no at spam-typo3.org
Tue Jul 13 09:59:58 CEST 2010


Am 12.07.2010 23:00, schrieb Thomas "Thasmo" Deinhamer:
> 
> About the chunk_split:
> In this case I can't use it, because I want to split the
> telephone number in segments, but beginning from the back!
> That's why I implemented a bit more complex code for that.

// assuming that number length exceeds segment length
$excess = strlen($telephoneNumber) % $segmentLength;
$telephoneNumber = substr($telephoneNumber, 0, $excess)
 . $segmentSeparator
 . chunk_split(substr($telephoneNumber, $excess), $segmentLength, $segmentSeparator);

Masi


More information about the TYPO3-project-typo3v4mvc mailing list