我对此功能有疑问,
function _where($arg, $separator = ' '){
if ($arg['where']){
$operators = '( |=|!=|<>|<|<=|>|>=|=~|!~|\?|\?!)';
foreach ($arg['where'] as $k => $v){
if (preg_match('/\[(.*)\]/i', $v, $match)){
foreach (explode('|', $match[1]) as $or){
$where[] = preg_replace('/(.*)'.$operators.'(.*)/i', '\\1\\2\'\\3\'', preg_replace('/\['.str_replace('|', '\|', $match[1]).'\]/i', $or, $v));
}
$result[] = '('.join(' or ', $where).')'."\r\n";
} elseif ($v != 'and' and $v != 'or' and $v != 'xor'){
$result[] = preg_replace('/(.*)'.$operators.'(.*)/i', '\\1\\2\'\\3\'', $v)."\r\n";
} else {
$result[] = $v."\r\n";
}
}
return 'where '.str_replace(array('!~', '=~'), array('not like', 'like'), join($separator, $result));
}
}
结果,
PHP Warning: preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Compilation failed: regular expression is too large at offset 63088
我正在使用相同的代码运行另一个站点,并且那里不存在问题,这个问题是否与db中的行数相关?