I
I
Icqibo2018-04-25 08:07:17
PHP
Icqibo, 2018-04-25 08:07:17

preg_match_all is not ignoring the page, why?

Hello ! I am making a page parser - soccer365.ru/games/11461852 via preg_match_all. This is the penultimate game between Roma and Liverpool. But for some reason the function gives out the data of the last game - here is the page soccer365.ru/games/911269/. I don't understand why at all. I ask for help

$html5 = file_get_contents( 'http://soccer365.ru/games/11461852/' );

preg_match_all( '#<body>(.+?.)</body>#is', $html5, $matches );
foreach ( $matches[1] as  $key=>$value8 ) {
${'K' . $key} = $value8;
echo "$value8<BR>";
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Mifle, 2018-04-25
@OlegMifle

Use curl to trace the request.

X
xmoonlight, 2018-04-25
@xmoonlight

(for a long time there were no such questions ... sorry in advance, but now it will be tough ...)
Learn to adequately ask a question first.
1. What is the input - INFORMATION DATA
2. What should be the output - INFORMATION DATA
3. And your code / attempts to implement - SOURCE CODE
By submitting:
1. Follow the links - travel yourself.
2.

This is the penultimate game of Roma and Liverpool
Damn, of course! Without this information, I would not have understood at all: what is it about!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question