regex - PHP - Match two strings ignoring span tags -


i looking function matches string string b (ignoring span tags)

a) shopping <span>stylish</span> rugs area  b) shopping stylish rugs area 

function should return true if match found else false, in above case should return true.

thanks

you can use strip_tags() remove tags string.

$a  = 'shopping <span>stylish</span> rugs area'; $b = 'shopping stylish rugs area'; var_dump(strip_tags($a) == $b); // outputs true 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -