前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >PHP 7.0.0中ereg_replace 函数使用preg_replace替换方法

PHP 7.0.0中ereg_replace 函数使用preg_replace替换方法

作者头像
前端皮皮
发布2020-11-26 10:43:30
1.7K0
发布2020-11-26 10:43:30
举报
文章被收录于专栏:前端进阶学习交流

在PHP 7.0.0中ereg_replace 函数使用preg_replace替换方法如下:

ereg_replace — Replace regular expression (在PHP 4, PHP 5中) 这个函数在PHP 5.3.0 中就已经不赞成使用,并在 PHP 7.0.0.中被移除

代码语言:javascript
复制
string ereg_replace ( string $pattern , string $replacement , string $string )

查看更多 http://php.net/manual/en/function.ereg-replace.php

preg_replace — Perform a regular expression search and replace (在PHP 4, PHP 5, PHP 7中)

代码语言:javascript
复制
mixed preg_replace ( mixed $pattern , mixed $replacement , mixed $subject [, int $limit = -1 [, int &$count ]] )

查看更多 http://php.net/manual/en/function.preg-replace.php

在PHP 7.0.0中ereg_replace 函数可使用preg_replace代替,只是将ereg_replace中的$pattern两边加上”/“以闭合如"/pattern/"。

下面介绍一个关于visual studio运行报错的方法:

visual studio 运行程序的时候,如果在运行过程中想要修改一些代码结果显示 changes are not allowed while code is running 如下所示,还要停止运行然后编辑完再运行查看结果,感觉很不方便而且效率低。

解决办法: 英文版:tools->options->debugging->general,将前面的勾选取消"Enable Edit and Continue”。

中文版:工具->选项->调试->常规->将 启用“编辑并继续”前面的对勾去掉如下图:

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2018-10-17,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 IT共享之家 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档