note 95822 added to function.preg-match
| From: | fusionstreamatgmail | Date: | Sat, 23 Jan 2010 18:51:30 +0000 |
| Subject: | note 95822 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-165239@lists.php.net to get a copy of this message | ||
I don't know about you guys but some of the examples in this page and it's resultant code
seem wrong in my browser.
preg_match is able to search for a regex pattern and return it's offset:
$str = "abcdefghijklmnopqrstuv";
$matches = array();
preg_match("/ghi/", $str, $matches, PREG_OFFSET_CAPTURE, 0);
print_r($matches);
will output
Array
(
[0] => Array
(
[0] => ghi
[1] => 6
)
)
----
Server IP: 208.69.120.55
Probable Submitter: 218.186.9.226 (proxied: 222.164.116.7)
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- https://master.php.net/note/edit/95822
Del: integrated -- https://master.php.net/note/delete/95822/integrated
Del: useless -- https://master.php.net/note/delete/95822/useless
Del: bad code -- https://master.php.net/note/delete/95822/bad+code
Del: spam -- https://master.php.net/note/delete/95822/spam
Del: non-english -- https://master.php.net/note/delete/95822/non-english
Del: in docs -- https://master.php.net/note/delete/95822/in+docs
Del: other reasons-- https://master.php.net/note/delete/95822
Reject -- https://master.php.net/note/reject/95822
Search -- https://master.php.net/manage/user-notes.php