0

hey guys i have an array in php and it contains some records twice, trice or so. I only want to list those records once while fetching array elements. eg. "entry 1" comes five times in the array then i want to display it only once and then next element. if i give print_r($array) comment then it show results like this.
Array ( [0] => Nueva Andalucia [1] => Nueva Andalucia [2] => Marbella East [3] => Golden Mile [4] =>

can anyone tell how to do this?

thanks.

2
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by dalip_007
0
$onlyone = array_unique($array);

gets rid of all duplicates

now only one is a array and doesnt have duplicates

Edited by HITMANOF44th: n/a

0

Yes, That did work. Thanks for reply. You seems to be an expert. :-)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.