Hi Say I want to search a text for a part which includes double quote. I can't use strpos for it. What else can I do. Say I am looking for (one"two):the following two code wouldn't work: $myString = strpos($text,"one"two"); $myString = strpos($text,"one\"two"); PHP: Any Idea?
This should be a good start. preg_match_all('([a-z0-9]+"[a-z0-9]+)', $text, $matches) this will return $matches, which is an array of all the found results: Array ( [0] => Array ( [0] => one"two [1] => this"may [2] => future"stuff ) ) Code (markup): -the mole PS, use preg_match_all('([a-z0-9]+"[a-z0-9]+)', $text, $matches, PREG_OFFSET_CAPTURE) to get the string offset