Fix `ereg is deprecated` errors in PHP 5.3

To migrate ereg():

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

to

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

To migrate ereg_replace():

$this->file_dst_name_body = ereg_replace('[^A-Za-z0-9_]', '', $this->file_dst_name_body);

to

$this->file_dst_name_body = preg_replace('/[^A-Za-z0-9_]/', '', $this->file_dst_name_body);

To migrate eregi():

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

to

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

Leave a Reply

Your email address will not be published. Required fields are marked *