Stay Hungry, Stay Foolish

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

PHP 8557℃ 0评论

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

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中)

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/"。

喜欢 (8)
取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦


Warning: Use of undefined constant PRC - assumed 'PRC' (this will throw an Error in a future version of PHP) in C:\inetpub\wordpress\wp-content\themes\XHBlog\comments.php on line 17
发表我的评论
取消评论

表情

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

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