I want to enter the site below, save all html in a variable, clean the html and save the content I want in the MySQL database via PHP 7 . p>
The site is: link
At first I "saved the HTML of the page" into a variable, as per the code below:
$mundo = 'ferobra';
$url = 'http://guildstats.eu/bosses?monsterName=&world=' . $mundo . '&rook=0' . $mundo;
function curl_get_contents($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$pagina = curl_get_contents($url);
My problem now is to clear HTML , save it to arrays and then populate the database.
Can anyone help me?