foreach ($arrQuestionId as $key=>$question) {
?>
<div class='lt-container'>
<p><strong>QUESTION <span id="quesnum"></span>:</strong></p>
</div>
<?php
}
?>
In code above I have a while loop where it displays QUESTION :. Now what I want to do is in between QUESTION and : I want to include a count number so that for every time QUESTION appears, it contains a count number next to it as like below:
QUESTION 1:
QUESTION 2:
QUESTION 3:
...
How can this be done?
Create a variable and increment it in foreach.
Like: