I have a string of text that I want to find out if the letter code DH exists in the string, and then perform a function if it does.

How can I check to see if the string contains those letter without doing something to the string like string replace, etc?

    I've tried but the position of this string can be anywhere, I need to scan the whole string and get a true/false if DH exists.

      strpos returns the position
      why don't you just check if the position is not false as described in the manual

      why don't you just read the manual page for strpos?
      the very first example does exactly what you want to achieve

        Write a Reply...