See this demo:
$document = "{title}this is the title{/title}";
preg_match("/{title}(.*){\/title}/", $document, $match);
//echo $match; // PHP Notice: Array to string conversion in /home/jxkaKh/prog.php on line 5
print_r($match);
// => Array( [0] => {title}this is the title{/title} [1] => this is the title)
See preg_match reference:
int preg_match ( string $pattern , string $subject [, array &$matches [, int $flags = 0 [, int $offset = 0 ]]] )
...
matches
If matches is provided, then it is filled with the results of search. $matches[0] will contain the text that matched the full pattern, $matches[1] will have the text that matched the first captured parenthesized subpattern, and so on.
And your pattern contains a capture group defined as (.*).
$matchis an array, useprint_r($match)