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

João Guilherme picture João Guilherme · Jul 15, 2009 · Viewed 88.7k times · Source

Anyone knows how to solve the error below?

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

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

Answer

Parmendra Singh picture Parmendra Singh · Aug 23, 2016

Use

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

Instead of

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