我想在数组值 $stopwords 前面连接字符“/\b”,并在后面连接字符“\b/i”。
我的帮手
function addRegex_SW($arrayIn = array()){
$arrayOut = array();
$count = count($arrayIn);
for ($i = 1; $i <= $count; $i++)
{
$char1 = "/\b";
$char2 = "\b/i";
$arrayOut[$i] = $char1.$arrayIn[$i].$char2;
//echo $arrayOut[$i];
}
return $arrayOut;
}
我的观点
$stopwords_Regex = addRegex_SW($stopwords);
然后当我运行代码时
A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 317
Filename: helpers/addRegex_helper.php
Line Number: 11
是哪条线
$arrayOut[$i] = $char1.$arrayIn[$i].$char2;
我确定我有谷歌它,但我仍然没有得到它。谢谢