PHP 5+ deprecated function ereg_replace....how to solve it?

Hi guys,
recently i’ve change my hosting service with another semi-professional :slight_smile:
I’ve change some paths on my site but i don’t manage to solve this:

Deprecated: Function ereg_replace() is deprecated in /home/byoryrxn/public_html/cloud-base.php on line 1262

I’ve tried to replace this with preg_replace but without lucky.
This is my link: http://www.meteocarmignano.it/cloud-base.php?uom=M&buster=2431017.7113

I’ve also attached my cloud-base.php file.
Thanks in advance for any help.
Regards,

Alessandro


cloud-base.php.txt (81.3 KB)

Try:

 $metar[1] = preg_replace("/[\n\r]/","",$raw_metar[1]); // strip linefeeds

Thanks Niko,
now it looks fine: http://www.meteocarmignano.it/cloud-base.php?uom=M&buster=2431017.7113
You’re awesome :slight_smile:

Regards,

Alessandro

Glad that worked, thanks for letting me know :smiley: