-1

Possible Duplicate:
How can I convert ereg expressions to preg in PHP?

What is the equivalent of this EREG_REPLACE function in PREG_REPLACE?

$html = ereg_replace("[^A-Za-z._0-9@ ]"," ",$html);
Community
  • 1
  • 1
awawjerh
  • 214
  • 1
  • 2
  • 12

2 Answers2

2
$html = preg_replace("/[^A-Za-z._0-9@ ]/"," ",$html);

The biggest difference is the delimiters on the ends, though there are others. Read here.

Nathanael
  • 6,893
  • 5
  • 33
  • 54
0

$html = preg_replace("/[^A-Za-z._0-9@ ]/"," ",$html);

preg_replace

Pedro del Sol
  • 2,840
  • 9
  • 39
  • 52