Pai asta care doar afiseaza,mai exact ia fiecare film si il separa de restul ca sa pot posta fiecare film individual.
Cod PHP:<?php
$data = file_get_contents('test.html');
$pattern_long = '{
<div\s+class="main"\s*>
(
(?:
(?: (?!<div[^>]*>|</div>). )++
|
<div[^>]*>(?1)</div>
)*
)
</div>
}six';
$pattern_short = '{<div\s+class="main"\s*>((?:(?:(?!<div[^>]*>|</div>).)++|<div[^>]*>(?1)</div>)*)</div>}si';
$matchcount = preg_match_all($pattern_long, $data, $matches);
echo("<pre>\n");
if ($matchcount > 0) {
echo("$matchcount matches found.\n");
for($i = 0; $i < $matchcount; $i++) {
echo("\nMatch #" . ($i + 1) . ":\n");
echo($matches[1][$i]);
}
} else {
echo('No matches');
}
echo("\n</pre>");
?>


Răspunde cu citat
