php中正则表达式匹配函数ereg是不是被弃用了?

php中正则表达式匹配函数ereg是不是被弃用了?


海绵宝宝撒
浏览 804回答 4
4回答

DIEA

是的 call_user_method()(使用 call_user_func() 替代) call_user_method_array() (使用 call_user_func_array() 替代) define_syslog_variables() dl() ereg() (使用 preg_match() 替代) ereg_replace() (使用 preg_replace() 替代) eregi() (使用 preg_match() 配合 ‘i’ 修正符替代) eregi_replace() (使用 preg_replace() 配合 ‘i’ 修正符替代) set_magic_quotes_runtime() 以及它的别名函数 magic_quotes_runtime() [color=olive]session_register() (使用 $_SESSION 超全部变量替代) session_unregister() (使用 $_SESSION 超全部变量替代) session_is_registered() (使用 $_SESSION 超全部变量替代) set_socket_blocking() (使用 stream_set_blocking() 替代) split() (使用 preg_split() 替代) spliti() (使用 preg_split() 配合 ‘i’ 修正符替代) sql_regcase() mysql_db_query() (使用 mysql_select_db() 和 mysql_query() 替代) mysql_escape_string() (使用 mysql_real_escape_string() 替代) 废弃以字符串传递区域设置名称. 使用 LC_* 系列常量替代. mktime() 的 is_dst 参数. 使用新的时区处理函数替代.

素胚勾勒不出你

preg_matchpreg_match_allpreg_replacepreg_replace_callback

慕神8447489

不会的..ereg_replace("\{".$num."\}", $this->array[$num], $this->template);这句以后..$this->template里面所有匹配$num的都会被替换掉下一次循环开始的时候就不会匹配到上一次的$num内容这时$regs[1]的内容就变了$num随之改变
打开App,查看更多内容
随时随地看视频慕课网APP