Inflection.php
private function _txtSplit($txt)
    {
        $skp = 1;
        $rv = [];

        $rvx = 0;
        $acc = '';

        $length = mb_strlen($txt, 'UTF-8');
        for ($i = 0; $i < $length; $i++) {
            if (mb_substr($txt, $i, 1, 'UTF-8') === ' ') {
                if ($skp) {
                    continue;
                }
                $skp = 1;
                $rv[$rvx++] = $acc;
                $acc = '';
                continue;
            }
            $skp = 0;
            $acc .= mb_substr($txt, $i, 1, 'UTF-8');
        }
        if (!$skp) {
            $rv[$rvx] = $acc;
        }
        return $rv;
    }
private function _txtSplit($txt)
    {
        $skp = 1;
        $rv = [];

        $rvx = 0;
        $acc = '';

        $length = mb_strlen($txt, 'UTF-8');
        for ($i = 0; $i < $length; $i++) {
            if (mb_substr($txt, $i, 1, 'UTF-8') === ' ') {
                if ($skp) {
                    continue;
                }
                $skp = 1;
                $rv[$rvx++] = $acc;
                $acc = '';
                continue;
            }
            $skp = 0;
            $acc .= mb_substr($txt, $i, 1, 'UTF-8');
        }
        if (!$skp) {
            $rv[$rvx] = $acc;
        }
        return $rv;
    }
Rozdeli text na slova

@param string $txt Vstupni text

@return array Text rozdeleny na slova