Answer the question
In order to leave comments, you need to log in
Collect all links in an array with the same end. I really need help!?
Actually, you need to collect links on the page ending with #watch#watch
/cinema/movies/32424_ttt_aaa/?autoplay=1#watch#watch
And I would also like to ask, besides the href attribute in PHP Simple HTML DOM Parser, what other attributes do links have? how, for example, can I use doom to find this link, and the links are different and many similar ones;
also, I note that after /cinema/movies/ there are always numbers + letters first?
Everything works with a piece of code :( the page does not work :D it is not clear why :( what could be the matter ?
Answer the question
In order to leave comments, you need to log in
<?
$str = File_get_contents("https://afisha.mail.ru/cinema/all/?year=2000&year=2020/");
$re = '/href=\"(.*?)#watch#watch/';
preg_match_all($re, $str, $matches);
// Print the entire match result
print_r($matches);
?>
https://regex101.com/r/BfLMvZ/1
What attributes can links have htmlbook.ru/html/a
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question