> array_unique() in php ~ Online tutorial

array_unique() in php

array_unique() function removes the duplicate values from an array.if two or more array values an the same ,the sirst apperence will be kept and the other will be removed
Syntax
arrray_unique(array)
Example

<?php
$sum=array(0=>"apple",1=>"orange",2=>"apple",);
echo "before using array unique";
print_r($sum);
echo "after using array unique";
print_r(array_unique($sum));

?>

Output
before using array unique

array(0=>apple
1=>orange
2=>apple)
after using array unique
array(0=>apple
1=>orange)

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: