src/DataHandling.php
public static function explode($string, $characters = ";>|/\\<")
    {
        $string = self::sanitizeString($string);

        if ($string === null) {
            return [];
        }

        // Convert characters into a safe regular expression
        $splitRegex = "";
        for ($i = 0; $i < strlen($characters); $i++) {
            $splitRegex .= "\\" . $characters[$i];
        }
        $splitRegex = "/[" . $splitRegex . "]/";

        $rawElements = preg_split($splitRegex, $string);
        $elements = [];
        foreach($rawElements as $rawElement) {
            $element = self::sanitizeString($rawElement);

            if ($element !== null) {
                $elements[] = $element;
            }
        }

        return $elements;
    }
public static function explode($string, $characters = ";>|/\\<")
    {
        $string = self::sanitizeString($string);

        if ($string === null) {
            return [];
        }

        // Convert characters into a safe regular expression
        $splitRegex = "";
        for ($i = 0; $i < strlen($characters); $i++) {
            $splitRegex .= "\\" . $characters[$i];
        }
        $splitRegex = "/[" . $splitRegex . "]/";

        $rawElements = preg_split($splitRegex, $string);
        $elements = [];
        foreach($rawElements as $rawElement) {
            $element = self::sanitizeString($rawElement);

            if ($element !== null) {
                $elements[] = $element;
            }
        }

        return $elements;
    }
public static function explode ( $ string , $ characters = ";>|/\\<" ) { $ string = self :: sanitizeString ( $ string ) ; if ( $ string === null ) { return [ ] ; } // Convert characters into a safe regular expression $ splitRegex = "" ; for ( $ i = 0 ; $ i < strlen ( $ characters ) ; $ i ++ ) { $ splitRegex .= "\\" . $ characters [ $ i ] ; } $ splitRegex = "/[" . $ splitRegex . "]/" ; $ rawElements = preg_split ( $ splitRegex , $ string ) ; $ elements = [ ] ; foreach ( $ rawElements as $ rawElement ) { $ element = self :: sanitizeString ( $ rawElement ) ; if ( $ element !== null ) { $ elements [ ] = $ element ; } } return $ elements ; }
Explodes a string into an array after performing sanitization on each element.

@param string $string
@param string $characters
@return string[]
Explodes a string into an array after performing sanitization on each element .