I'm trying to extract value of each html tag from my string into array. This is my str value:
str = '<li><a href="/somelink1">name1</a></li><li><a href="/somelink2">name2</a></li><li><a href="/somelink3">name3</a></li>'
I want to extract each name (name1, name2, name3) and put it into array. So the output should be:
output = Array(
[0] => 'name1',
[1] => 'name2',
[2] => 'name3'
)
I was looking for some function that may do something similar, but no luck at all :/