Let's say I have this string:
$myString = 'aaa = b AND cc = dd OR e = ff_%_g AND hh = iii AND j = k_%_lll ...'
I want to check if the substring '_%_' is present, and in that case, I want to replace the previous (and only the previous) '=' by a 'LIKE'.
Namely, I want this:
$myString = 'aaa = b AND cc = dd OR e LIKE ff_%_g AND hh = iii AND j LIKE k_%_lll ...'
I know how to replace all the '=' using strpos() and substr_replace(), but I need to replace only those that precede a '_%_'
Any help, please?