SyntaxFix
Write A Post
Hire A Developer
Questions
Use print_r($votes); to inspect the array $votes, you will see that key 0 does not exist there. It will return NULL and throw that error.
print_r($votes);
$votes
0