update page now
Laravel Live Japan

Voting

: max(three, five)?
(Example: nine)

The Note You're Voting On

chrysb at gmail dot com
17 years ago
If you are looking for a way to count the total number of times a specific value appears in array, use this function:

<?php
function array_value_count ($match, $array)
{
    $count = 0;
    
    foreach ($array as $key => $value)
    {
        if ($value == $match)
        {
            $count++;
        }
    }
    
    return $count;
}
?>

This should really be a native function of PHP.

<< Back to user notes page

To Top