Right now I use a PHP snippet to grab some content from a website with the following code, and show the content in my project and its work good.
<?php
$lines = file ("https://the-url.com");
for ($i = 1664; $i <= 2325; $i++) {
echo $lines[$i];
}
?>
But the problem is that sometimes the code in the middle of the site change and i have to update the php snippet with the new lines from the content.
How can write the PHP code so that i say i need the content between
<div class="results" id="result_list">
And
<h3 id="alternativen_text" style="float: left; width: 100%;padding-bottom: 6px">
can i use like ?
<?php
$lines = file ("https://the-url.com");
preg_match('/<div class="results" id="result_list">(.*?)<\/<h3 id="alternativen_text" style="float: left; width: 100%;padding-bottom: 6px">/s', $lines, $match[1]); {
echo $match[1];
}
?>