Posted on September 10, 2018October 6, 2018 by winnieHow to find a specific string in a variable Code: $var = "I am a developer"; if (strpos($var, 'dev') !== false) { echo 'true'; } Output: true