Regular Expression For Search Functionality
I am implementing a search functionality for some static pages. My Content is in p tag's, span, div, li's. If I search a word which is in p tag then it get searched but except that non of the word get searched. Below is the regular expression which I am using:
preg_match_all("/\<p\>(.*)".$_GET['s']."(.*)\<\/p\>/i", $contents, $matches, PREG_SET_ORDER);
I want such a regular expression which will search all the words no matter it is in p tag, span, div or li. it should get searched.
Can someone help?