亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何修復preg_match()未知修飾符'?在localeconv()中

如何修復preg_match()未知修飾符'?在localeconv()中

PHP
米琪卡哇伊 2021-05-08 15:14:05
問題出在 'decimal_point' => string '/'但是沒有人有好的解決方案嗎?錯誤:  preg_match() unknown modifier '?'功能 :     * @param   string  $str    input string     * @return  boolean     */    public static function numeric($str)    {        // Get the decimal point for the current locale        list($decimal) = array_values(localeconv());        // A lookahead is used to make sure the string contains at least one digit (before or after the decimal point)         return (bool) preg_match('/^-?+(?=.*[0-9])[09]*+'.preg_quote($decimal).'?+[0-9]*+$/D', (string) $str); }這是localeconv()dump:array (size=18)  'decimal_point' => string '/' (length=1)  'thousands_sep' => string ',' (length=1)  'int_curr_symbol' => string 'IRR' (length=3)  'currency_symbol' => string '????' (length=8)  'mon_decimal_point' => string '/' (length=1)  'mon_thousands_sep' => string ',' (length=1)  'positive_sign' => string '' (length=0)  'negative_sign' => string '-' (length=1)  'int_frac_digits' => int 2  'frac_digits' => int 2  'p_cs_precedes' => int 0  'p_sep_by_space' => int 0  'n_cs_precedes' => int 0  'n_sep_by_space' => int 0  'p_sign_posn' => int 3  'n_sign_posn' => int 3  'grouping' =>     array (size=1)      0 => int 3  'mon_grouping' =>     array (size=1)      0 => int 3
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 177 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號