Fri, 17 May 2024


How to remove the duplicate values from a PHP array?

By: Nathalie, NetArt Media
Sat, 29 May 2021

<?php

$arr=array("netart","media","netart");

$newArray=array_unique($arr);

foreach($newArray as $strItem)

{
echo $strItem."<br>";
}

?>


Category: PHP Examples
Share this post:



See All Scripts






Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox