I'm creating a table based upon an imported .csv file.
This works fine however I want to spit out the company name once.
So this is the csv:
company,value
company1, 231
company1, 432
company1, 876
If I foreach
the data into a table I want to display the companyname
once.
echo'<table><tr><td>Companyname</td><td>Value</td>';
foreach ($data as $gegevens){
$companyname = $gegevens['Companyname'];
$value = $gegevens['Value'];
echo '<tr><td>'.$companyname.'</td><td>'.$value.'</td></tr> ';
}
echo'</table>';
This is what I want to have as output:
[Companyname] [Value]
[company 1 ] [231]
[ ] [432]
[ ] [876]
Any thoughts on how I can accomplish this?