This should be pretty straightforward, but I can't seem to find an explanation anywhere on how to do it.
I have a string in PHP. That string might contain within it somewhere the substring ":ERROR:". I need to find if it has that string. strpos()
has worked perfectly up to this point, until today when ":ERROR:" was the first item in the string, so strpos()
returned 0
, so the program kept running thinking it had no error.
I don't need to replace the string, or do any manipulation to it, I just need a simple true/false
answer to "does :ERROR: exist in the string?"