I am working on an education based module where a list is shown for "Module 1" to "Module 5". Each "Module" has 'n' number of chapters. Now I want to show a progress bar which shows the study duration of each chapter in that "Module". I am unable to split the progress bar, into 'n' numbers(equal to chapters for each module) and to show reading time of each chapter in that 'Module'.
Here is my code:
<td align='center'>
<?php
while ($j<=$chapters){ //$chapters has count of chapters for each module and $j is increment variable initialized to 1 at start.
echo '<progress value="150" max="500">'; $j=$j+1;} ?>
</td>
Try this, seems you are confused with quotes
<td align='center'>
<?php
echo "<progress value='" . $seconds . "' max='" . $total_time ."'>";
?>
</td>
Like Thamaraiselvam said, you seem to be confused with quotes:
<td align="center">
<?php
echo '<progress value="'.$seconds.'" max="'.$total_time.'">';
?>
</td>
PHP can use either single quotes ('
) or double quotes ("
), but in your case, it makes more sense to use single quotes. This is because HTML needs double quotes. If you use double quotes, you'd have to escape the HTML double quotes, otherwise, it would be interpreted as the end/beginning of a string by PHP (confusing, I know).
Just a piece of advice, it's shorter to use:
<td align="center">
<?= '<progress value="'.$seconds.'" max="'.$total_time.'">' ?>
</td>
Or even:
<td align="center">
<progress value="<?= $seconds ?>" max="<?= $total_time ?>">
</td>