Php – How to solve the use of deprecated function ereg() of PHP 5.3.0 in Drupal 6.13


Anyone knows how to solve the error below?

Deprecated: Function ereg() is deprecated in C:\wamp\www\includes\ on line 895

It is happening after installing Drupal 6.13 on wamp server 2.0i with PHP 5.3.0

Best Solution


preg_match('/\.([^\.]*$)/', $this->file_src_name, $extension);

Instead of

ereg('\.([^\.]*$)', $this->file_src_name, $extension);