faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 3 people (33%) answered Yes
Recently 1 of 3 people (33%) answered Yes

Entry

How can I extract metatag keywords from pages serving longtext mysql column info?

Nov 27th, 2008 14:23
healthy man, dman, Jakub Vrana, Paul O\'Donnell, http://www.ttnr.org


You can use something like:
$keywords = "";
preg_match_all('~<meta([^>]*)~i', $file, $matches);
foreach ($matches[1] as $attribs) {
    if (preg_match('~name=[\'"]Keywords~i', $attribs)
    && preg_match('~content=[\'"]([^\'"]+)~i', $attribs, $value)) {
        $keywords = $value[1];
    }
}
http://www.healthdothealth.com
http://www.healthxhealth.com
http://www.mesotheliomainmesothelioma.com
http://www.healthfirewall.com
http://www.flathealth.com
http://www.healthbodyguard.com