I'm trying to find if a substring exists inside of a larger string. The match has to be exact. Most of the time it works be in the scenario below it says its an exact match even though it is not.
$partnumber = "4.7585";
$productname = "Eibach 4.7585.880 Sport Plus Kit"
if(preg_match('/^.*(\b'.$partnumber.'\b).*$/i', $productname)){
echo "****************Exact Match****************";
}
It should only match if the $partnumber = '4.7585.880';
As a note, the partnumber could change, it could contain numbers, letters, decimals or dashes.