0

That is my code:

preg_match('/\<span id\="([a-zA-Z0-9\s]+?)\"\>([a-zA-Z0-9\s]+?)\<\/span\>/', '<span id="1">test</span> <span id="2">test1</span>', $match);

    var_dump($match);

But why in $match array have only id=1 and test?

Defense
  • 259
  • 4
  • 21

1 Answers1

2

I believe you are looking for preg_match_all.

voldomazta
  • 1,300
  • 1
  • 10
  • 19