I want to insert data from included file and create HTML-elements automatically.
In data.php I have:
$vps_de_dc1_s1 = array(
"name"=>"Germany, DC1, First",
"price"=>"10€",
);
$vps_de_dc1_s2 = array(
"name"=>"Germany, DC1, Second",
"price"=>"10€",
);
$vps_de_dc2_s1 ..., $vps_de_dc2_s2 ..., $vps_cz_dc1_s1 ..., $vps_cz_dc12_s1 ..., etc.
And in page.php there should be:
include('data.php');
<tr class="vps_de_dc1">
<td class="column-left">
name
</td>
<td class="column-right">
$vps_de_dc1_s1["name"]
</td>
<td class="column-right">
$vps_de_dc1_s2["name"]
</td>
<td class="column-right">
$vps_de_dc1_s3["name"]
</td>
</tr>
<tr class="vps_de_dc2">
<td class="column-left">
name
</td>
<td class="column-right">
$vps_de_dc2_s1["name"]
</td>
<td class="column-right">
$vps_de_dc2_s2["name"]
</td>
<td class="column-right">
$vps_de_dc2_s3["name"]
</td>
</tr>
...
I want to know, is it possible to automate somehow creation of table elements here?
Update: In fact, for echo
I have to manually create all table instances. But I want to find a way to create all these <tr class="vps_*_dc*">...</tr>
automatically for every $vps_*
from data.php.