Last active
March 7, 2023 01:08
-
-
Save pchatterjee/481c272be8f7e92592dcbf50231873d4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $fh = fopen("survey.csv", "r"); | |
| $header = TRUE; | |
| echo '<table>'; | |
| while (!feof($fh)) { | |
| $rec = fgetcsv($fh); | |
| echo '<tr>'; | |
| if ($header) { | |
| foreach($rec as $f) { | |
| echo '<th>'.$f.'</th>'; | |
| $header = FALSE; | |
| } | |
| } | |
| else { | |
| echo '<td>'.$rec[0].'</td>'; | |
| echo '<td>'.$rec[1].'</td>'; | |
| echo '<td>'.$rec[2].'</td>'; | |
| echo '<td><img width="90px" src="./images/'.$rec[3].'"/></td>'; | |
| echo '<td><a href="mailto:'.$rec[4].'">'.$rec[4].'</a></td>'; | |
| echo '<td><a href="'.$rec[5].'">'.$rec[5].'</a></td>'; | |
| } | |
| echo '</tr>'; | |
| } | |
| echo '</table>'; | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment