Last active
August 10, 2017 07:24
-
-
Save titomus/6d2202be0f4642af78aa3829d1ed4ee5 to your computer and use it in GitHub Desktop.
Récupérer les mots clés d'un site web via sa balise meta keywords
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_site_kw($url){ | |
$meta = get_meta_tags($url); | |
$keywords = $meta['keywords']; | |
$keywords = @explode(',', $keywords ); | |
$keywords = array_map( 'trim', $keywords ); | |
$keywords = array_filter( $keywords ); | |
return $keywords; | |
} | |
// utilisation | |
get_site_kw('http://site.com') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment