S
S
Sergey Vladimirovich2016-12-12 12:46:29
PHP
Sergey Vladimirovich, 2016-12-12 12:46:29

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

2 answer(s)
S
Sergey Vladimirovich, 2016-12-12
@spamboo

<?

$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);





?>

D
Dmitry Dart, 2016-12-12
@gobananas

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 question

Ask a Question

731 491 924 answers to any question