• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

关于PHP5.3作废函数的处理方法_php

php 搞代码 7年前 (2018-06-21) 139次浏览 已收录 0个评论

  作废函数如下:

  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 参数. 使用新的时区处理函数替代.

  处理方法:editplus编辑器中,正则替换

  替换ereg(),eregi():用preg_match替换

  ereg/("([^"]+)"替换为:preg_match("//1/"

  ereg/('([^"]+)'替换为:preg_match('//1/'

  eregi/("([^"]+)"替换为:preg_match("//1/i"

  eregi/('([^"]+)'替换为:preg_match('//1/i'

  替换ereg_replace(),eregi_replace():用preg_replace()替换

  ereg_replace/("([^"]+)"替换为:preg_replace("//1/"

  ereg_replace/('([^"]+)'替换为:preg_replace('//1/'

  ereg_ireplace/("([^"]+)"替换为:preg_replace("//1/i"

  ereg_ireplace/('([^"]+)'替换为:preg_replace('//1/i'

  如果 ereg_replace 的第一个参数不是正则表达式,可以用 str_replace 直接来替换

  split用explode替换或preg_split替换

欢迎大家阅读《关于php5.3作废函数的处理方法_php》,跪求各位点评,若觉得好的话请收藏本文,by 搞代码


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:关于PHP5.3作废函数的处理方法_php

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址