public static function explode($value, string $delimiter = ',')
    {
        self::validateIfObjectIsAString($value);

        if (empty($delimiter)) {
            throw new \InvalidArgumentException(
                "Delimiter '" . var_export($delimiter, true) . "' is not a non-empty string"
            );
        }

        return explode($delimiter, $value);
    }
public static function explode($value, string $delimiter = ',')
    {
        self::validateIfObjectIsAString($value);

        if (empty($delimiter)) {
            throw new \InvalidArgumentException(
                "Delimiter '" . var_export($delimiter, true) . "' is not a non-empty string"
            );
        }

        return explode($delimiter, $value);
    }
public static function explode ( $ value , string $ delimiter = ',' ) { self :: validateIfObjectIsAString ( $ value ) ; if ( empty ( $ delimiter ) ) { throw new \ InvalidArgumentException ( "Delimiter '" . var_export ( $ delimiter , true ) . "' is not a non-empty string" ) ; } return explode ( $ delimiter , $ value ) ; }
Explodes a string into an array using the given delimiter.

For example, given the string 'foo,bar,baz', this would return the array ['foo', 'bar', 'baz'].

@param string $value The string to explode.
@param string $delimiter The non-empty delimiter to explode on.
@return array The exploded values.

@throws \InvalidArgumentException if the delimiter does not pass validation.
Explodes a string into an array using the given delimiter .