Quick and dirty solution…

<form method="post" action="">
	<textarea name="words"><?php echo $_POST['words'];?></textarea>
	<br>
	<input type="submit">
</form>
<?php
if($_POST):
	$dict = file('wordlist.txt');
	$list = array();
	$res  = array();
	
	foreach ($dict as $word):
		$word = str_replace("\n", "", $word);
		$word = str_replace("\r", "", $word);
		$tmp = str_split($word);
		sort($tmp);
		$tmp = implode('', $tmp);
		$list[$tmp] = $word;
	endforeach;
	
	$input	= $_POST['words'];
	$words	= explode("\n", str_replace("\r", "", $input));
	
	foreach($words as $word):
		$tmp = str_split($word);
		sort($tmp);
		$tmp = implode('', $tmp);
		echo $list[$tmp].",";
	endforeach;
	
endif;