I'm trying to run the preg_replace function on a string but only if the variable $animal DOESN'T = "sheep". The problem is that the conditional statement I'm using (see below) doesn't run the function at all, even if the variable $animal equals something other than "sheep".
I'm using the preg_replace function because I want to replace only the first instance of the word "sheep". str_replace doesn't give me the option to do this. Is the preg_replace function really so slow? Doesn't seem so to me.