Greggy-php
New member
what i cant understand is even before the application can start i get an error inside line 88 of my index.php file which is where i have this code…
Code:
<?php
$data = "./data-new-data";
$dir = scandir($data);
$users = [];
// $i starts at 2 to skip the dir entries '.' and '..'
for ($i = 2, $size = count($dir); $i < $size; ++$i) {
$users[] = explode("-", $dir[$i])[0];
// $split = explode("-", $dir[$i]);
// $users[$split[0]][] = $split[1];
}
/*foreach ($users as $key => $value) {
$users[$key] = array_unique($value);
} */
foreach (array_unique($users) as $user){
echo '<li> <a class="submenu2" href="graph-1.php?user=' . $user . '">',
'<i class="icon-bar-chart"></i><span class="hidden-tablet">' . $user . '</span></a></li>';
}
?>
Last edited: