Answer the question
In order to leave comments, you need to log in
How to parse a block on a page?
Tell me, please, what should be the regular expression in order to parse from the page everything that is between
and
I, alas, still cannot comprehend these regular expressions :(<div id="programm">
<div id="programm_up">
$link = "http://www.teleguide.info/kanal100055_20160413.html";
$page = file_get_contents($link);
preg_match(, $page, $matches);
Answer the question
In order to leave comments, you need to log in
<?php
$link = "http://www.teleguide.info/kanal100055_20160413.html";
$page = file_get_contents($link);
$regExpWrapper = "#(?:<div id=\"programm\">)(.*?)(?:<div id=\"programm_up\">)#si";
preg_match_all($regExpWrapper, $page, $matches);
echo iconv("UTF-8", "CP1251", $matches[1][0]);
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question