public static function explode(string $separator, string $content, ?callable $itemFunction = null): array
    {
        if ($separator === "\n") {
            $content = str_replace("\r", '', $content);
        }
        $items = explode($separator, $content);
        if (is_callable($itemFunction)) {
            foreach ($items as $index => $item) {
                $items[$index] = $itemFunction($item);
            }
        }
        return $items;
    }
public static function explode(string $separator, string $content, ?callable $itemFunction = null): array
    {
        if ($separator === "\n") {
            $content = str_replace("\r", '', $content);
        }
        $items = explode($separator, $content);
        if (is_callable($itemFunction)) {
            foreach ($items as $index => $item) {
                $items[$index] = $itemFunction($item);
            }
        }
        return $items;
    }
public static function explode ( string $ separator , string $ content , ? callable $ itemFunction = null ) : array { if ( $ separator === "\n" ) { $ content = str_replace ( "\r" , '' , $ content ) ; } $ items = explode ( $ separator , $ content ) ; if ( is_callable ( $ itemFunction ) ) { foreach ( $ items as $ index => $ item ) { $ items [ $ index ] = $ itemFunction ( $ item ) ; } } return $ items ; }
Explode string into items.

@param string $separator If "\n", "\r", will be removed before explode.
@param string $content
@param callable $itemFunction
@return string[]
Explode string into items .