I want to extract elements from a webpage.
$html = file_get_contents($link);
That function returns the complete html file, and I only want the internal and external links to save them in the database.
$sql = "INSERT INTO prueba (link, title, description) VALUES (?, ?, ?)";
//preparando los datos
$query = $pdo->prepare($sql);
//orden de ejecucion
$result = $query->execute([
$link,
$title_out,
$description
]);
Here, I am already managing to extract the description and the title, and I manage to place them in the database, but I want to extract all the external and internal links. The internal links in one column and the external links in another. I already have both columns in the database created.