Migrate from ereg_replace to preg_replace

dannySM

New Member
Just migrating from PHP 5.2 to 5.3, lot of hard work! Is the following ok, or would you do something differently?\[code\]$cleanstring = ereg_replace("[^A-Za-z0-9]^[,]^[.]^[_]^[:]", "", $critvalue);\[/code\]to\[code\]$cleanstring = preg_replace("[^A-Za-z0-9]^[,]^[.]^[_]^[:]", "", $critvalue);\[/code\]Thanks all
 
Top