CImage.php
private function checkFileExtension($extension)
    {
        $valid = array('jpg', 'jpeg', 'png', 'gif', 'webp');

        in_array(strtolower($extension), $valid)
            or $this->raiseError('Not a valid file extension.');

        return $this;
    }
private function checkFileExtension($extension)
    {
        $valid = array('jpg', 'jpeg', 'png', 'gif', 'webp');

        in_array(strtolower($extension), $valid)
            or $this->raiseError('Not a valid file extension.');

        return $this;
    }
private function checkFileExtension ( $ extension ) { $ valid = array ( 'jpg' , 'jpeg' , 'png' , 'gif' , 'webp' ) ; in_array ( strtolower ( $ extension ) , $ valid ) or $ this -> raiseError ( 'Not a valid file extension.' ) ; return $ this ; }
Check if file extension is valid as a file extension.

@param string $extension of image file.

@return $this
Check if file extension is valid as a file extension .