I have a string like below. I want to write a preg_match_all() function to get 'one' and 'two'. What change have to be done to the expression below to get the desired result?
$featureTab = "<li>one</li><li id='someId'>two</li>";
I have tried below code.
preg_match_all('/(?<=\<li\>)(.*?)(?=\<\/li\>)/', $featureTab ,$matches);
But it just returns 'one'. as the pregx only considers strings between the li tag not with id. Help me with a regular expression that will return both one and two.