Reputation: 35
I am looking for a function that matches string A with string B (ignoring span tags)
a) Shopping for <span>Stylish</span> Rugs Area
b) Shopping for Stylish Rugs Area
Function should return TRUE if match is found else FALSE, so in above case it should return TRUE.
Thanks
Upvotes: 2
Views: 92
Reputation: 6202
You can use strip_tags()
to remove the tags from string.
$a = 'Shopping for <span>Stylish</span> Rugs Area';
$b = 'Shopping for Stylish Rugs Area';
var_dump(strip_tags($a) == $b); // outputs true
Upvotes: 4