Answer the question
In order to leave comments, you need to log in
Why does preg_match_all return an empty array?
Good evening, I'm trying to write a parser, I take the page through cURL (everything is fine, the page is completely taken away)
then I want to pull out all the links to the news using a regular expression, here's the code:
preg_match_all("/<div class=\"article\">.*href=\"(.*)\">/U", $html, $links);
Answer the question
In order to leave comments, you need to log in
that's all, I deduced, it was necessary to push an array into a variable that gives preg_match_all
Here is what you need, IMHO - https://github.com/Imangazaliev/DiDOM
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question