Link to home
Start Free TrialLog in
Avatar of mescalin
mescalin

asked on

"Deprecated: Function ereg_replace() is deprecated in" Php 5.3

Hello,

 I have following line was working well in php 5.2 but not in 5.3. Is it possible to fix it?

      
$q = ereg_replace("S", "s", $q);

Open in new window

Avatar of wkcarlson
wkcarlson

Try using preg_match.
Avatar of Marco Gasi
You have to use preg_replace instead.

$q = preg_replace("S", "s", $q);
In your case you can use str_replace instead.
Here you find info about preg_replace function: http://it.php.net/manual/en/function.preg-replace.php

Cheers
SOLUTION
Avatar of pius_babbun
pius_babbun

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh, yeah, pius_babbun is rigth: I forgot to mention to add delimiters: $q = preg_replace("/S/", "s", $q);

I'm sorry. :-)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial