Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Is there any function to find repeated value in an array?
What is w2 standard



Is there any function to find repeated value in an array? What is w2 standard..

Answer / amitverma

Yes, there's a function for everything in PHP :)
To see the repeated values in an array you may use function
array_count_values($array);

This function will return you an array, consisting each
vaule's frequency associated with it.


##
#Following Code -

$array = array(1, "hello", 1, "world", "hello");
print_r(array_count_values($array));

##
#Outputs -

Array
(
[1] => 2
[hello] => 2
[world] => 1
)

Is This Answer Correct ?    11 Yes 3 No

Post New Answer

More PHP Interview Questions

What are the different data types in javascript?

1 Answers  


What is the use of addslashes in php?

0 Answers  


which is the best institute for php training near delhi & NCR......& what is the fee for the same....

2 Answers  


What is the difference between "echo" and "print" in php?

0 Answers  


what is PDO?

0 Answers  


What is MIME?

2 Answers  


How cookies are trported from browsers to servers?

0 Answers  


How to add different images in php program like a job site.......

2 Answers  


Can we use include ("xyz.php") two times in a php page "index.php"?

0 Answers  


How can we display the output directly to the browser?

0 Answers  


How to find out, how a user visited a particular page?

4 Answers   Yahoo,


Is PHP is procedure oriented or object oriented?

10 Answers   DLF, Net Solution,


Categories