Skip to content

Instantly share code, notes, and snippets.

@titomus
Last active August 10, 2017 07:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save titomus/6d2202be0f4642af78aa3829d1ed4ee5 to your computer and use it in GitHub Desktop.
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
<?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