当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_STR_isDigit函数代码示例

本文整理汇总了PHP中PMA_STR_isDigit函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_STR_isDigit函数的具体用法?PHP PMA_STR_isDigit怎么用?PHP PMA_STR_isDigit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_STR_isDigit函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMA_SQP_parse


//.........这里部分代码省略.........
                     $type .= 'backtick';
                     break;
                 default:
                     break;
             }
             // end switch
             $data = PMA_substr($sql, $count1, $count2 - $count1);
             PMA_SQP_arrayAdd($sql_array, $type, $data, $arraysize);
             continue;
         }
         // Checks for brackets
         if (PMA_STR_strInStr($c, $bracket_list)) {
             // All bracket tokens are only one item long
             $count2++;
             $type_type = '';
             if (PMA_STR_strInStr($c, '([{')) {
                 $type_type = 'open';
             } else {
                 $type_type = 'close';
             }
             $type_style = '';
             if (PMA_STR_strInStr($c, '()')) {
                 $type_style = 'round';
             } elseif (PMA_STR_strInStr($c, '[]')) {
                 $type_style = 'square';
             } else {
                 $type_style = 'curly';
             }
             $type = 'punct_bracket_' . $type_type . '_' . $type_style;
             PMA_SQP_arrayAdd($sql_array, $type, $c, $arraysize);
             continue;
         }
         // Checks for identifier (alpha or numeric)
         if (PMA_STR_isSqlIdentifier($c, FALSE) || $c == '@' || $c == '.' && PMA_STR_isDigit(PMA_substr($sql, $count2 + 1, 1))) {
             $count2++;
             //TODO: a @ can also be present in expressions like
             // FROM 'user'@'%'
             // or  TO 'user'@'%'
             // in this case, the @ is wrongly marked as alpha_variable
             $is_sql_variable = $c == '@';
             $is_digit = !$is_sql_variable && PMA_STR_isDigit($c);
             $is_hex_digit = $is_digit && $c == '.' && $c == '0' && $count2 < $len && PMA_substr($sql, $count2, 1) == 'x';
             $is_float_digit = $c == '.';
             $is_float_digit_exponent = FALSE;
             // Nijel: Fast skip is especially needed for huge BLOB data, requires PHP at least 4.3.0:
             if (PMA_PHP_INT_VERSION >= 40300) {
                 if ($is_hex_digit) {
                     $count2++;
                     $pos = strspn($sql, '0123456789abcdefABCDEF', $count2);
                     if ($pos > $count2) {
                         $count2 = $pos;
                     }
                     unset($pos);
                 } elseif ($is_digit) {
                     $pos = strspn($sql, '0123456789', $count2);
                     if ($pos > $count2) {
                         $count2 = $pos;
                     }
                     unset($pos);
                 }
             }
             while ($count2 < $len && PMA_STR_isSqlIdentifier(PMA_substr($sql, $count2, 1), $is_sql_variable || $is_digit)) {
                 $c2 = PMA_substr($sql, $count2, 1);
                 if ($is_sql_variable && $c2 == '.') {
                     $count2++;
                     continue;
开发者ID:BackupTheBerlios,项目名称:vhcs-svn,代码行数:67,代码来源:sqlparser.lib.php

示例2: PMA_SQP_parse


//.........这里部分代码省略.........
            // end switch
            $data = PMA_substr($sql, $count1, $count2 - $count1);
            PMA_SQP_arrayAdd($sql_array, $type, $data, $arraysize);
            continue;
        }
        // Checks for brackets
        if (PMA_strpos($bracket_list, $c) !== false) {
            // All bracket tokens are only one item long
            $this_was_bracket = true;
            $count2++;
            $type_type = '';
            if (PMA_strpos('([{', $c) !== false) {
                $type_type = 'open';
            } else {
                $type_type = 'close';
            }
            $type_style = '';
            if (PMA_strpos('()', $c) !== false) {
                $type_style = 'round';
            } elseif (PMA_strpos('[]', $c) !== false) {
                $type_style = 'square';
            } else {
                $type_style = 'curly';
            }
            $type = 'punct_bracket_' . $type_type . '_' . $type_style;
            PMA_SQP_arrayAdd($sql_array, $type, $c, $arraysize);
            continue;
        }
        /* DEBUG
           echo '<pre>1';
           var_dump(PMA_STR_isSqlIdentifier($c, false));
           var_dump($c == '@');
           var_dump($c == '.');
           var_dump(PMA_STR_isDigit(PMA_substr($sql, $count2 + 1, 1)));
           var_dump($previous_was_space);
           var_dump($previous_was_bracket);
           var_dump($previous_was_listsep);
           echo '</pre>';
           */
        // Checks for identifier (alpha or numeric)
        if (PMA_STR_isSqlIdentifier($c, false) || $c == '@' || $c == '.' && PMA_STR_isDigit(PMA_substr($sql, $count2 + 1, 1)) && ($previous_was_space || $previous_was_bracket || $previous_was_listsep)) {
            /* DEBUG
               echo PMA_substr($sql, $count2);
               echo '<hr />';
               */
            $count2++;
            /**
             * @todo a @ can also be present in expressions like
             * FROM 'user'@'%' or  TO 'user'@'%'
             * in this case, the @ is wrongly marked as alpha_variable
             */
            $is_identifier = $previous_was_punct;
            $is_sql_variable = $c == '@' && !$previous_was_quote;
            $is_user = $c == '@' && $previous_was_quote;
            $is_digit = !$is_identifier && !$is_sql_variable && PMA_STR_isDigit($c);
            $is_hex_digit = $is_digit && $c == '0' && $count2 < $len && PMA_substr($sql, $count2, 1) == 'x';
            $is_float_digit = $c == '.';
            $is_float_digit_exponent = false;
            /* DEBUG
               echo '<pre>2';
               var_dump($is_identifier);
               var_dump($is_sql_variable);
               var_dump($is_digit);
               var_dump($is_float_digit);
               echo '</pre>';
                */
开发者ID:nhodges,项目名称:phpmyadmin,代码行数:67,代码来源:sqlparser.lib.php

示例3: PMA_STR_isAlnum

/**
 * Checks if a character is an alphanumeric one
 *
 * @uses    PMA_STR_isUpper()
 * @uses    PMA_STR_isLower()
 * @uses    PMA_STR_isDigit()
 * @param   string   character to check for
 * @return  boolean  whether the character is an alphanumeric one or not
 */
function PMA_STR_isAlnum($c)
{
    return PMA_STR_isUpper($c) || PMA_STR_isLower($c) || PMA_STR_isDigit($c);
}
开发者ID:fathitarek,项目名称:cop5725-dbms-project,代码行数:13,代码来源:string_type_native.lib.php

示例4: PMA_STR_isAlnum

/**
 * Checks if a character is an alphanumeric one
 *
 * @uses    PMA_STR_isUpper()
 * @uses    PMA_STR_isLower()
 * @uses    PMA_STR_isDigit()
 * @param   string   character to check for
 * @return  boolean  whether the character is an alphanumeric one or not
 */
function PMA_STR_isAlnum($c)
{
    return (PMA_STR_isUpper($c) || PMA_STR_isLower($c) || PMA_STR_isDigit($c));
} // end of the "PMA_STR_isAlnum()" function
开发者ID:blumenbach,项目名称:blumenbach-online.de,代码行数:13,代码来源:string_type_native.lib.php


注:本文中的PMA_STR_isDigit函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。