How to remove duplicate values from array using php?



How to remove duplicate values from array using php?..

Answer / Subham Kumar

Use the array_unique() function, which returns an array with all the duplicate values removed. For example: $arr = array(1, 2, 3, 3, 4, 4, 5); $newArr = array_unique($arr);

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

How to get path of php.ini with a php script?

1 Answers  


how to send mail in php but mail should be send in inbox not in spam.....:(

2 Answers   ATS,


What is the difference between super () and this ()?

1 Answers  


Explain what is the main difference between require() and require_once()?

1 Answers  


How to get no. of rows using MYSQL function?

1 Answers  


What is the latest version of php?

1 Answers  


Explain about image types in detail?

1 Answers   Aplora,


Is c similar to php?

1 Answers  


What is the best php framework 2018?

1 Answers  


Under what circumstance is it impossible to assign a default value to a parameter while declaring a function?

1 Answers  


How many types of arrays are there in php?

1 Answers  


What types of MYSQL function available for affecting columns

1 Answers  


Categories