Re: Problem with regex

From: Date: Thu, 13 Jul 2000 21:04:55 +0000
Subject: Re: Problem with regex
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-6545@lists.php.net to get a copy of this message
> Why does $titleArray[0] include the <title></title> > tags? Shouldn't the parenthesis '()' make it so that > it returns only what is between them? http://www.php.net/manual/function.ereg.php int ereg (string pattern, string string [, array regs]) Searchs string for matches to the regular expression given in pattern. If matches are found for parenthesized substrings of pattern and the function is called with the third argument regs, the matches will be stored in the elements of regs. $regs[1] will contain the substring which starts at the first left parenthesis; $regs[2] will contain the substring starting at the second, and so on. $regs[0] will contain a copy of string.

« previous php.general (#6545) next »