I have this following Array. Here, i want to count the variable fraction which has the value 1. Based on the no.of.occurances, i want to do some operations. The one way i know is, to loop the array by using foreach and put an incrementor to identify how many fraction has the value 1. But i want to know is there any easier way than the above one?
could anyone suggest me?
Array
(
[0] => Array
(
[answer] => <p>
Quiz Test Interoperability</p>
[feedback] =>
[fraction] => 0
)
[1] => Array
(
[answer] => <p>
Quiz Test Interrelationship</p>
[feedback] => <br />
[fraction] => 0
)
[2] => Array
(
[answer] => <p>
Quiz Team Interoperability</p>
[feedback] => <br />
[fraction] => 0
)
[3] => Array
(
[answer] => <p>
Queation Test Interoperability</p>
[feedback] => <br />
[fraction] => 1
)
)