I have a html file and two keywords and i want to get all text which resides inside those two keywords. Should i use regex? I want to take those two keywords as input. It would be helpful if you give an example.
Yes, use Regex: keyword1(.*?)keyword2
. PHP example:
preg_match_all('/'.$kwdOne.'(.*?)'.$kwdTwo.'/s', $str, $matches);
Read: preg_match_all() and Pattern Modifiers.