I'm trying to formulate some dummy data so that I can developed the front end of a html data table, to do this im writing the data out once and using str_repeat
to out put it multiple times.
One of the features I'm incorporating in the front end is the ability to sort columns but to do that I need different data in each row. I planned to use rand()
to assist with this part, but when I use it with the code block below, it generates a random number and the str_repeat
outputs that 3 times..
Is there a simple way to get it to run the rand()
func on each iteration of the str_repeat()
func ?
$html = "
<tr>
<!-- Unit Price -->
<td class='table-input input-number'>
<input class='input-center' value='" . rand(10,200) . "'>
</td>
<!-- QTY -->
<td class='table-input input-number'>
<input class='input-center' value='" . rand(1,5) . "'>
</td>
</tr>";
echo str_repeat($html,3);