Mayccoll
1/7/2016 - 7:13 PM

Filter PDF links

Filter PDF links

<?php
function THEME_get_link_pdf ($content) {
  $string = $content;
  $re1='((?:http|https)(?::\\/{2}[\\w]+)(?:[\\/|\\.]?)(?:[^\\s"]*))';    # HTTP URL 1
  $re2='(pdf)'; # Word 1
  preg_match_all("/".$re1.$re2."/is", $string, $match);
  return $match;
}
?>