Home :: International :: Manuals :: Howto :: FAQ :: Man Pages :: Email Login

 
 

 

array_count_values

(PHP 4 , PHP 5)

array_count_values -- 配列の値の数を数える

説明

array array_count_values ( array input)

array_count_values()は、 配列inputの値をキーとし、 inputにおけるその値の出現回数を値とした 配列を返します。

例 1. array_count_values()の例

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

上のプログラムは以下のような結果を出力します

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

 
 
 
 
Google
  Web Linuxinfor   
 

Home :: Copyright :: Privacy :: Credits :: Get a free Linuxinfor Email Account

Document on this page is part of "PHP マニュアル". See Index Page for more info about Authorship and Copyright.

1999-2009 Linuxinfor.com. No rights reserved.