标签:
int preg_match ( string $pattern , string $subject [, array &$matches [, int $flags = 0 [, int $offset = 0 ]]] )
<?php
$subject = "abcdef";
$pattern = ‘/^def/‘;
preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE, 3);
print_r($matches);
?>
pattern 的匹配次数。 它的值将是0次(不匹配)或1次,因为preg_match()在第一次匹配后 将会停止搜索。subject 直到到达结尾。 如果发生错误preg_match()返回 FALSE。 标签:
原文地址:http://www.cnblogs.com/07byte/p/5961521.html