I am working with php,I have associative array and i want to count total number of array (using loop) whose key is "IsRatingQuestion" and value is ="1" Here is my array
Array
(
[0] => Array
(
[ques_id] => 2
[question] => Please enter your mobile number.
[IsRatingQuestion] => 0
[ISSubQuestion] =>
)
[1] => Array
(
[ques_id] => 2
[question] => Lorem Ipsum dummy text
[IsRatingQuestion] =>
[ISSubQuestion] =>
)
[2] => Array
(
[ques_id] => 15
[question] => Would your recommend TOSSIN ?
[IsRatingQuestion] => 1
[ISSubQuestion] =>
)
[3] => Array
(
[ques_id] => 18
[question] => which type of mobile you have ?
[IsRatingQuestion] =>1
[ISSubQuestion] => 1
)
Here is my php code ( Right now counting all records/array),i want to count array whose key is "IsRatingQuestion" and value is ="1",How can i do this ? Thanks in advance.
<?php
$count=count($rec);
for ($j = "2"; $j < $count+"1"; $j++)
{
?>
<li>Step <?php echo $j; ?></li>
<?php } ?>