【发布时间】:2013-04-16 15:40:47
【问题描述】:
我想在数组值$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;
我确定我有谷歌它,但我仍然没有得到它。 谢谢
【问题讨论】:
标签: php regex codeigniter helper