explode

@param string   $delimiter
@param int|null $limit

@return  array
160753
public function explode($delimiter, $limit = null)
    {
        // Fix HHVM default explode limit issue
        // @see  https://github.com/facebook/hhvm/issues/7696
        // @see  https://3v4l.org/fllad
        if ($limit === null) {
            $limit = defined('HHVM_VERSION') ? 0x7FFFFFFF : PHP_INT_MAX;
        }

        return explode($delimiter, $this->string, $limit);
    }
520544
public static function part($str, $i, $delimiter, $default = null)
    {
        $parts = explode($delimiter, $str);

        return isset($parts[$i])
            ? $parts[$i]
            : $default;
    }
776101
public static function csvFileToArray($filename='', $delimiter=',')
    {
        $header = null;
        $data = [];
        if (($handle = fopen($filename, 'r')) !== false) {
            while (($row = fgetcsv($handle, 1000, $delimiter)) !== false) {
                if (!$header) {
                    $header = $row;
                } else {
                    $data[] = array_combine($header, $row);
                }
            }
            fclose($handle);
        }

        return $data;
    }
974687
public function recvLine($delimiter = "\n") {
        $str = '';
        while (!$this->stream_eof()) {
            $char = $this->recvChr();
            $str .= $char;
            if ($char === false) { return $str; }
            if (strpos($str, $delimiter) !== false) { return $str; }
        }
        return $str;
    }
159779
public static function stringToArray($string = false, $delimiter = ' ', $limit = false) {

        if ($string && Validate::isString($string)) {

            if($limit) {

                return explode($delimiter, $string, $limit);
            }

            return explode($delimiter, $string);
        }

        return false;
    }
25518
public function explode($delimiter): array
    {
        Assert::typeOf(['string', __CLASS__], $delimiter);

        $response = [];
        $results  = explode((string) $delimiter, $this->data);

        if ($results === false) {
            throw new RuntimeException('An unknown error occurred while splitting string!');
        }

        foreach ($results as $result) {
            $response[] = new static($result, $this->encoding);
        }

        return $response;
    }
805561
public function parse(string $data, callable $cast = null, string $delimiter = ','): array
    {
        $data = \trim($data);

        $parser = $this->parser($data, $cast, $delimiter);
        $data = \iterator_to_array($parser);

        if ($parser->getReturn() !== '') {
            throw new ParseException("Data left in buffer after parsing");
        }

        return $data;
    }
535625
public function split($separator)
    {
        $hash = new Hash(explode((string) $separator, (string) $this));

        return $hash->map(
            function ($value) {
                return new String($value);
            }
        );
    }
340391
protected function iteratorToArray(Traversable $config, $delimiter) {
		$rows = [];
		
		foreach ($config as $key => $value) {
			if ($value instanceof Traversable) {
				foreach ($this->iteratorToArray($value, $delimiter) as $subkey => $subvalue) {
					$rows[$key . $delimiter . $subkey] = $subvalue;
				}
			} else {
				$rows[$key] = $value;
			}
		}
		
		return $rows;
	}
579559
public static function concat(iterable $pieces, ?string $delimiter = null): self
    {
        $delimiter = is_null($delimiter) ? Text::EMPTY_TEXT : $delimiter;

        $temp = TextVector::make($pieces)
            ->concat($delimiter);

        return self::make($temp);
    }
283855
private function explode($string, $delimiter)
    {
        $result = [];
        while (($pos = strrpos($string, $delimiter)) !== false) {
            $result[] = ($string = substr($string, 0, $pos));
        }
        return $result;
    }
457253
public static function csplit($string, $delimiter = ',')
    {
        if (is_array($string)) {
            return $string;
        }
        $res = [];
        foreach (explode($delimiter, $string) as $k => $v) {
            $v = trim($v);
            if (strlen($v)) {
                array_push($res, $v);
            }
        }

        return $res;
    }
1061286
public function encode($data, $delimiter = null): string
    {
        if (count($data) === 0) {
            return '';
        }
        $delimiter = $delimiter ?? $this->getDelimiter();
        $header = array_keys(reset($data));

        // Encode the field names
        $string = implode($delimiter, $header). "\n";

        // Encode the data
        foreach ($data as $row) {
            $string .=  implode($delimiter, $row). "\n";
        }

        return $string;
    }
414391
public function get($delimit = true)
	{
		// If there are still open delimiters throw an exception
		if ($this->openDelimiters !== 0)
		{
			throw new \LogicException('A delimiter has not been closed!');
		}

		$expression = $this->expression;

		if ($delimit)
		{
			$expression = '/' . $expression . '/'  . $this->flags;
		}

		return $expression;
	}
1199318
private function processParams($uri, $delimiter = ':')
    {
        if (strpos($uri, $delimiter) !== false) {
            preg_match_all(static::paramsRegex(), $uri, $matches, PREG_SET_ORDER);

            foreach ($matches as $match) {
                $param = explode($delimiter, $match[1]);
                if (count($param) === 2) {
                    $plain_var = filter_var($param[1], FILTER_SANITIZE_STRING);
                    $this->params[$param[0]] = $plain_var;
                    $uri = str_replace($match[0], '', $uri);
                }
            }
        }
        return $uri;
    }
369419
public static function explode($string, $delimiter)
    {
        if (!String::isValid($string) ||
            String::isEmpty($string)) {
            return false;
        }

        return explode($delimiter, $string);
    }
623797
public function cropMiddle($text, $maxLength, $delimiter = '...')
    {

        // return text if it doesn't need to be cropped
        if (!$text || strlen($text) <= $maxLength || !substr($text, 0)) {
            return $text;
        }

        $substrLength = floor(($maxLength - strlen($delimiter)) / 2);

        return substr($text, 0, $substrLength).$delimiter.substr($text, -$substrLength);
    }