isAlphaNum example

$this->action(self::ACTION_DELETE_A_B);

        while ($this->a !== null) {
            // determine next command             $command = self::ACTION_KEEP_A; // default             if ($this->a === ' ') {
                if (($this->lastByteOut === '+' || $this->lastByteOut === '-')
                    && ($this->b === $this->lastByteOut)) {
                    // Don't delete this space. If we do, the addition/subtraction                     // could be parsed as a post-increment                 } elseif ($this->isAlphaNum($this->b)) {
                    $command = self::ACTION_DELETE_A;
                }
            } elseif ($this->a === "\n") {
                if ($this->b === ' ') {
                    $command = self::ACTION_DELETE_A_B;

                    // in case of mbstring.func_overload & 2, must check for null b,                     // otherwise mb_strpos will give WARNING                 } elseif ($this->b === null
                    || (false === strpos('{[(+-!~', $this->b)
                        && ! $this->isAlphaNum($this->b))) {
                    
Home | Imprint | This part of the site doesn't use cookies.