I want to show the data from this in each row of my html table, how do I do that?
<?php
$test = $object2->schoolname;
$array = explode(',', $test);
echo $array[0];
//print_r($myArray); --> output: Array( [0] => testSchool2 [1] => test)
?>
The only way I can think of is to use something like this:
<td>
<input type="text" name='schoolname[]' value="<?php
$test = $object2->schoolname;
$array = explode(',', $test);
echo $array[0];
?>" class="form-control"/>
</td>
But I have to do it for every row, I want to show that if I have 2 datas inside the array, then 2 of the row must contain those data, I don't want to manually put in the array[0] like this. How can I do that? Can anyone help me? Thanks a lot.
My html table is based on this: https://bootsnipp.com/snippets/featured/dynamic-table-row-creation-and-deletion