I am currently using CURL to clean my website. I want to reliably get a title, description and keywords.
if (strlen($link_html) > 0)
{
$tags = get_meta_tags($link);
$link_keywords = $tags['keywords'];
$link_description = $tags['description'];
}
The only problem is that now users use all kinds of meta tags, such as an open graph <meta property="og:title" content="The Rock" />. They also strongly distinguish between tags <title> <Title> <TITLE> <tiTle>. It is very difficult to get this reliable data.
I really need code that will retrieve these variables sequentially. If there is any name, keyword and description, provided that he finds it. Because now it seems that he is very amazed and bored.
Perhaps a way to extract all the headers into a caption array? . The scrambling web developer can then choose the best one to write to his database. The same applies to keywords and descriptions.
This is not a duplicate. I did a search through stackoverflow and nowhere does this solution put all the "title", "keywords" and Tags of type "description" in arrays.
source
share