Last active
May 12, 2023 07:51
-
-
Save RoelofWobben/4f11710a52dd8e01bfd2813625df76b9 to your computer and use it in GitHub Desktop.
This file contains 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
[{ | |
"resource": "/c:/xampp/htdocs/roelof/opdracht1/experimental.php", | |
"owner": "_generated_diagnostic_collection_name_#3", | |
"severity": 8, | |
"message": "'(' expected.", | |
"source": "php", | |
"startLineNumber": 10, | |
"startColumn": 11, | |
"endLineNumber": 10, | |
"endColumn": 11 | |
}] |
This file contains 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 | |
// ONLY FOR TESTING | |
error_reporting(E_ALL); | |
function readCsvFile (): array { | |
$rows = []; | |
if (($handle = fopen("stock.csv", "r")) !== FALSE) { | |
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { | |
$rows[] = $data; | |
} | |
fclose($handle); | |
} | |
return $rows; | |
}; | |
$data = readCsvFile(); | |
function displayCSVData() { | |
?> | |
<div class="phppot-container"> | |
<table class="striped"> | |
<thead> | |
<tr> | |
<th>Symbol</th> | |
<th>Price</th> | |
<th>Symbol</th> | |
</tr> | |
</thead> | |
<tr class="data"> | |
<td> | |
<?php echo $data[0]; ?> | |
</td> | |
<td> | |
<?php echo $data[2] ?>;"<?php echo $data[1]; ?> | |
</td> | |
</tr> | |
</table> | |
</div> | |
} | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment