<?php $a = file_get_contents("daya.txt"); $b = file_get_contents("dayb.txt"); $d = file_get_contents("dayd.txt"); $ar= preg_split("/\s/", "$a $b $d"); $ar= array_unique($ar); file_put_contents("daye.txt", join("\n",$ar));