Array()の使い方
869 ワード
<?php
$my_array = array("a" => "Dog", "b" => "Cat", "c" => "Horse");
//=>
sort($my_array);//
print_r($my_array);
?>
<?php
$my_array = array( "Dog", "Cat","Horse","Dog");
print_r(array_count_values($my_array));
?>//
<?php
$my_array = array( "Dog", "Cat","Horse","Dog");
print_r(array_unique($my_array));
?>//
<?php
$my_array = array( "Dog", "Cat","Horse","Dog");
$count = count($my_array);
print_r($count);
?>//
<?php
$my_array = array(0=>"2" ,1=>"4");
$ss = array_sum($my_array);
echo($ss)
?>//