How to take name in one preg_match
- by Julianto
Hello guys,
I am trying to extract just the names result from the hypothetical HTML file below.
<ul class="cat">
<li>sport</li>
<li>movie</li>
</ul>
<ul class="person-list">
<li>name 1</li>
<li>name 2</li>
<li>name 3</li>
<li>name 4</li>
<li>name 5</li>
<li>name 6</li>
</ul>
Ideally, the result should come in an array format like the one below:
Array(
name 1 ,
name 2 ,
name 3 , ..........
)
OK I can easily do this with 2 regex matches but I was wondering if I can do it with just one.
Thanks in advance!