1 2 3 4 5 6 7 8
$parts = []; $text = $message->getText(); arsort($splits, SORT_NUMERIC); foreach ($splits as $split) { $parts[$split] = mb_substr($text, $split); $text = mb_substr($text, 0, $split); } ksort($parts);
You can clone a snippet to your computer for local editing. Learn more.