1
        $regex = '/\b'.$keyword.'\b/i'; // case insensitive match
        if (preg_match($regex, $linkedin_html) == 0)
        {
            $this->_htmlValidationFailed++;
            continue;                
        }

当我使用此代码时..我收到错误作为未知修饰符'v'..

请让我知道是什么问题并帮助我纠正。

4

1 回答 1

3
<?php
$keyword = preg_quote( $keyword, '/' );

$regex = '/\b'.$keyword.'\b/i'; // case insensitive match
if (preg_match($regex, $linkedin_html) == 0)
{
   $this->_htmlValidationFailed++;
   continue;                
}
于 2012-07-09T11:44:25.983 回答