I'm getting movie info from a movie site using Simple Html Dom.
<?php
include("simple_html_dom.php");
$html = file_get_html("http://arcoplex.com.br/?lang=059");
To get the titles of the movies I do:
foreach($html->find('.Cartaz .filme-single-name text') as $titulo) {
echo $titulo . '<br>';
}
To get the src of the movie cover images I do:
foreach($html->find('.Cartaz .filme-img') as $capa) {
echo $capa->src . '<br>';
}
To get the link from the movies I do:
foreach($html->find('.Cartaz .mais_info a') as $link) {
echo $link->href . '<br>';
}
The result is like this:
Knowing all this, how do I merge the information of each movie into an array / json together?
Example:
{
filmes: {
1: {
titulo: 'A FREIRA',
capa: 'http://arcoiriscinemas.com.br/2014/wp-content/uploads/2018/08/mini2-1-175x285.jpg',
link: 'http://arcoplex.com.br/filme/a-freira-2/?lang=059'
},
2: ...............,
3: ...............,
etc,
}
}