<?php
	function FilterWords($Comment)
	{
		$File = file_get_contents('OffensiveWords.txt');
		$Words = preg_split("#\r?\n#", $File, -1, PREG_SPLIT_NO_EMPTY);
	
		$Words = array_filter($Words);
		$pattern = "#\b(". implode('|',$Words).")\b#";
	
		if(preg_match($pattern, $Comment)) {
			echo("Bad word Detected");
		}
			else {
			echo("clean");
		}
	}
?>