I'm having a problem that the code is returning "Men" for all of the "Women" values because it also contains the term "Men." I've tried "~\bWord\b~" in vain.

How can the code below be edited to return different values?

```
function replaceWords($value) {
//here are predefined values
$predefined = array(
array(
'search'=>'Women',
'replaceWith'=>'Women'
),
array(
'search'=>'Men',
'replaceWith'=>'Men'
)
);
//search and replace
$found = false;
foreach ($predefined as $item) {
$search = array_map('trim', explode(',', $item['search']));
foreach ($search as $s) {
if (strstr(strtolower($value), strtolower($s))) {
$found = true;
$value = $item['replaceWith'];
break;
}
}
}
return ($found)?$value:"";
}

```

Help is much appreciated.