I want to concatenate characters "/\b" in front of array value $stopwords, and concatenate characters "\b/i" in the back.
My helper
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;
}
My view
$stopwords_Regex = addRegex_SW($stopwords);
Then when I run the code
A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 317
Filename: helpers/addRegex_helper.php
Line Number: 11
Which line is
$arrayOut[$i] = $char1.$arrayIn[$i].$char2;
I'm sure I had google it, but I dont still get it. Thanks