So I know this answer has been asked before, but after reading them I am still not understanding where my error is. From what I've gathered, I would throw this exception if I was referencing an element of the array that didn't exist, however, I am, and my code uses this to further execute. Does anyone know what is wrong with this code? I am getting undefined offset 1 - 16.
for($i=0; $i < count($Users); $i++) {
$row = explode(",", $Users[$i]);
if ($row[$i] == $user){
$userstring="$row[0]".","."$row[1]".","."$row[2]".","."active\n";
}
}
Edit to show user and users vars:
$user = $_GET['username'];
$Users = file("../writeable/users.txt");