Monday, October 24, 2016

PHP - Detect Facebook user agent

<?php
if(preg_match('/^FacebookExternalHit\/.*?/i',$agent)){
    print "Facebook User-Agent detected!";
}
?>

No comments:

Post a Comment