Hallo Ich arbeite an htmldom mit Laravel mein html ist wie unterHTMLDOM verschachtelte div
<div class="content">
<h4 class="title">Now Showing</h4>
<div class="movies">
<div class="movie">
<h4 class="movie-title">3D: Star Trek Beyond</h4>
<p class="movie-type">PG</p>
</div>
<div class="movie">
<h4 class="movie-title">Movie 2</h4>
<p class="movie-type">PG</p>
</div>
</div>
<h4 class="title">Comming Soon</h4>
<div class="movies">
<div class="movie">
<h4 class="movie-title">Some Other</h4>
<p class="movie-type">PG</p>
</div>
</div>
</div>
Ich möchte eine Ausgabe wie diese
Jetzt Zeige
3D: Star Trek Jenseits
Movie 2
Demnächst
Some Other
Ich versuchte
foreach($html->find('div[class=content]') as $content)
{
//tried this but it only return one item
//$heading = $content->find('h4[class=title]');
foreach($content->find('div[class=movies]') as $movies)
{
foreach($movies->find('div[class=movie]') as $movie)
{
$info = $movie->find('h4[class=movie-title]');
$movie_info[]=array(
'title'=>$info[0]->innertext
);
}
$qfx[] = array(
'main_title'=>'test',//$heading[1]->innertext,
'mov_details' =>$movie_info
);
unset($movie_info);
}
}
print_r($qfx)
von oben ich in der Lage bin
3D zu drucken: Star Trek Jenseits
Movie 2
Some Other
aber nicht in der Lage Drucken Hauptüberschrift Jetzt zeigt und Komm bald ie (h4 class = "title") bitte helfe
Glauben Sie nicht, DomDocument zu benutzen? – splash58