CC Zona wrote:
> 
> What is the functional difference between preg_match() and
> preg_match_all()?  I've puzzled over the manual descriptions for both,
> checked the list archives and faqts.com, and still can't figure out why
> they seem to return different results for the same pattern searches.
> 

Use a some text to match against where there's many places for a match
to occur. When you use the PREG_PATTERN_ORDER, for the order argument with 
preg_match_all, it's like a global match, collecting the matches and
subpatterns (obtained by using parenthesis, which will 'remember' the
subpatterns) in the 2dim array for your viewing pleasure.

Something like that. I usually have to wrestle with it a bit to get it straight
how the results from the subpattern matches (from the memorizing parens) are
ordered in the array to get the a loop to spit everything back out correctly.
If your nesting parens, I think it's you just start counting the opening paren
from the left, and they'll match sequentially as indexes in the associated array
for that particular match. Well, the 0 index is the entire match, and the subpat
matches pick up at index 1.

But, if the winds blowing from the east, and .....
;-)
MD


> TIA
> 
> --
> CC
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to