Web >> Development >> PHP >> How to intepret the array of matches from preg_match

eg $string = "one two three four"; preg_match("/(one).*(two)/",$string,$matches) when it returns true, $matches[0] = entire string $matches[1] = first substring match i.e. one $matches[2] = second substring match i.e. two