How to Remove Multiple Value From Array in PHP?

Dec 05, 2022

.

Admin

How to Remove Multiple Value From Array in PHP?

Hi Dev,

This article will give you example of how to remove multiple Value from array in php. we will help you to give example delete an array element based on value in php. you can see remove multiple values using php. you will learn remove multiple array_unique function use in php. you will do the following things delete multiple elements by Value in php.

Remove duplicate values from an array using array_unique() function

Example 1:


index.php

<?php

$example = ["a"=>"red","b"=>"green","c"=>"blue","d"=>"red"];

//Get remove multiple values from array

$result = array_unique($example);

print_r($result);

?>

Output:

Array

(

[a] => red

[b] => green

[c] => blue

)

I hope it could help you...

#PHP