Jump to content

delete duplicate


1zeus1

Recommended Posts

How can I delete duplicate in $data?
 
$data = array();
 
foreach ($get->find('h3[class=r] a') as $e) {
//---//
$data[] = "$var1,$var2"; 
}
$file = "/var/www/html/top;
$Handle = fopen($file, 'a') or die("Unable to open file!");
 
fwrite($Handle, implode("\n", $data));
fclose($Handle);
 
 
 
I tried this, but it does not work
 
$data = array();
foreach ($get->find('h3[class=r] a') as $e) {
//---//
$data[] = array_unique($var1,$var2); 
}
$file = "/var/www/html/top;
$Handle = fopen($file, 'a') or die("Unable to open file!");
 
fwrite($Handle, implode("\n", $data));
fclose($Handle);
 
Regards.

 

Link to comment
https://forums.phpfreaks.com/topic/297520-delete-duplicate/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.