Home / PHP Tips Generated By ChatGPT / Checking if a String Contains a Substring in PHP Use strpos() to find the position of the first occurrence of a substring in a string. Source Code if (strpos("Hello, World!", "World") !== false) { echo "Found!"; }