I am trying to parse meta-tags (description, keywords) out of $Data. I have the html of the website in $Data and I would like to put the contents of those meta-tags in there own vars like $Description and $Keywords. This is as far as I have got but I cant seam to figure out how to get the keywords into $keywords and the description into $description. Please keep in mind that the order of the meta-tag may not always be in this order.
Does anyone know how this can be done?
$Data = "<meta name=\"keywords\" content=\"php, mysql, php templates, apache, php
manual, server, pdf, database, flash, phpbuilder, content management
system, sql, script, oracle, string, xml, regular expressions, php5,
webalizer, php tutorials, code, nusoap, classes, developers\"><meta name=\"description\" content=\"some description about php and other stuff.\">";
preg_match_all("/<meta.+?content\s*=\s*([\"']?)(.+?)\\1.*?>/is", $Data,$Matches);
print_r ($Matches);