1

I have html content with multiple links(a href) , I need to extract the text between the <a> tag.
I have to do it with php.
I tried this code :

  preg_match_all('/<a\s+href=["\']([^"\']+)["\']/i',$response['content']['html'], $result);

This seems to be not the appropriate solution.

Any help will be appreciated.

Jbadminton
  • 2,055
  • 3
  • 22
  • 45

1 Answers1

-1

thanks for response , but I found the answer for my question , this works just fine for me , I just changed the regex expression and here is my code:

 preg_match_all('#<\s*?a href\b[^>]*>(.*?)</a\b[^>]*>#s',$response['content']['html'], $result);