php - Strpos find brand names -


$pos = strpos($arr_row1['name'], $arr_row['value']." "); if ($pos !== false){ 

the following code helps me match product title brand have array of brands "gopro", "hp" etc... unusual brands such "dy" "ge". problem code match "ready" brand "dy" , if chacne match " " . brand . " " not match brands title if stars "hp laptop" ideas how avoid issues , still match right brand title?

try following :

$pos = preg_match('/\b('.$arr_row1['name'].')\b/', $arr_row['value']); if ($pos == 1) { 

Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -