函数ereg_replace()在php 5.3中被弃用了

时间:2012-07-31 15:15:33

标签: php ereg-replace

我有一个erg_replace表达式。 İnphp5.3它给出了一个eroor,因为“函数ereg_replace()已被弃用”。我该如何解决?

$new_string = preg_replace("/[^a-zA-Z0-9s']/", " ", $ara);

$reg_ex = "";
$replace_word = "''"; 

$new_string= ereg_replace($reg_ex, $replace_word, $new_string);

2 个答案:

答案 0 :(得分:0)

ereg_replace()已弃用。使用preg_replace($reg_ex, $replace_word, $new_string);

答案 1 :(得分:0)