亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

php計(jì)算數(shù)組相同值出現(xiàn)次數(shù)的代碼(array_count_values)

 更新時(shí)間:2015年01月20日 23:05:47   投稿:mdxy-dxy  
這篇文章主要介紹了php計(jì)算數(shù)組相同值出現(xiàn)次數(shù)的代碼,需要的朋友可以參考下

php計(jì)算數(shù)組相同值出現(xiàn)次數(shù),可以使用php自帶函數(shù)array_count_values

說(shuō)明

array array_count_values ( array $input )array_count_values() 返回一個(gè)數(shù)組,該數(shù)組用 input 數(shù)組中的值作為鍵名,該值在 input 數(shù)組中出現(xiàn)的次數(shù)作為值。

array_count_values() 例子

復(fù)制代碼 代碼如下:

<?php
$array = array(1, "hello", 1, "world", "hello");
print_r(array_count_values ($array));
?>

以上例程會(huì)輸出:

復(fù)制代碼 代碼如下:

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

相關(guān)文章

最新評(píng)論