1// This problem can be solved adding the “s” modifier to the regular
2// expression. With this modifier, the “.” wildcard character matches
3//any possible character in the string, including newlines:
4
5preg_match("#<body>(.*)</body>#s",$document,$matches)