Last active
December 27, 2015 08:08
-
-
Save seinoxygen/7293612 to your computer and use it in GitHub Desktop.
Simple function to avoid junk content in comments.
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 | |
/* | |
* Return how much compression was applied to the comment. | |
*/ | |
function repetitive($comment){ | |
if(strlen($comment) / strlen(gzcompress($comment)) > 10) { | |
return true; | |
} | |
return false; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment