Re: PHP_OFFSET_CAPTURE
| From: | Marek Kilimajer | Date: | Wed, 01 Oct 2003 11:32:19 +0000 |
| Subject: | Re: PHP_OFFSET_CAPTURE | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-164532@lists.php.net to get a copy of this message | ||
Documentation is little unclear about this, by return means the third argument. Try print_r($hits);
Joerg H. Baach wrote:
Hi, I have this litte tiny test-script test.php: <? $var= preg_match_all("|a(b)+|","abbabbabbaa",$hits, PREG_OFFSET_CAPTURE); print '$var: '; print_r($var); ?> I would asume that $var would be an array, containing the offsets of the found matches. Instead it is just a simple integer containing the number of matches. Pretty much looks like preg_match_all is not returning the right thing. [joerg@dars regex]$ php test.php $var: 3 [joerg@dars regex]$ php -v PHP 4.3.3 (cli) (built: Sep 26 2003 19:58:02) Copyright (c) 1997-2003 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies Is it just me, or is it a bug? Thanks a lot, Joerg