I'm still a newbie when it comes to PHP, so I need help to correct this code.
What does it do?
It opens a file (file.txt), then it looks if there are duplicates en when they do the code will hide one or more of the double ones, and final it shows the code without the dups + ONLY the last 10 from the list. But the code is not finished, so I get errors. It must be something wth the 'echo implode' thing.
Code: Select all
<?php
$file = "file.txt";
$dups = array_unique (explode ("\n", str_replace("\n<a href=\x22http://www.domain.com/start/\x22></a></br>", "", file_get_contents($file))));
echo implode ("\n", $dups)("",array_slice(file("$file"),-10,10));
?>