0

I need a , b and c

 <ol class="commalist" id="list">
<li><a class="username" href="http://www.siteurl/member/1/">a</a>, </li>
<li><a class="username" href="http://www.siteurl/member/4/">b</a>, </li>
<li><a class="username" href="http://www.siteurl/member/555/">c</a>, </li>
</ol>

i test

preg_match_all('/<a class="username" href="http:\/\/www.siteurl\/member\/(.*)\/>(.*?)<\/a>/s', $output, $matches);

but dont work. pls help me. tnx

Mr-EsSi
  • 60
  • 1
  • 7

1 Answers1

0

Please see this answer about why parsing [X]HTML with Regex is a bad idea. (Plus your first .* is too greedy.)

Community
  • 1
  • 1
Larry Shatzer
  • 3,579
  • 8
  • 29
  • 36