Skip to content

Instantly share code, notes, and snippets.

@brianjking
Forked from av-jok/csvtotable.php
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianjking/e604c9c467413e1de355 to your computer and use it in GitHub Desktop.
Save brianjking/e604c9c467413e1de355 to your computer and use it in GitHub Desktop.
<?php
$a = explode("\n", $input);
foreach ($a as $key => $line)
{
$a[$key] = explode(",", $line);
};
foreach ($a as $element)
{ $output .="
<tr>
<td>
{$element[0]}
</td>
<td>
{$element[1]}
</td>
<td>
{$element[2]}
</td>
<td>
{$element[3]}
</td>
<td>
{$element[4]}
</td>
<td>
{$element[5]}
</td>
</tr>";
};
return $output;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment