php check if variable starts with code example Example: Check if string starts with php substr( $string_n, 0, 4 ) === "http"