Page 1 of 1

Now you can count the value of array without null values....

Posted: Thu Jul 10, 2008 4:33 am
by pavanjham
Hello Guies i am sending you the new function of php with name xcount which count the values of array without having the null values.here firstly you have to send the array parameter and after ,we are checking the value exist or not through the while looping with list case ,if value is exist here than its increment the counter and return the array value without null....

Code: Select all

function xcount($med) {
        while (list($key, $value) = each($med)) {
                if ($value) {
                        $count++;
                }
        }
        echo $count;
return $count;
}

Thanks