Skip to content
Advertisement

Warning: Undefined array key in php for unknown reason

Hello everyone
I was practicing php arrays and my editor cannot detect an error I have with my php however when it runs I get the error message

Warning: Undefined array key 3 in php

while still printing the output correctly.
my html form is:

JavaScript

my php form is:

JavaScript

and the php program file to run it all is:

JavaScript

After entering sample data in the forms and trying to execute the code this error message appears: Screenshot of error
Can someone please tell me what my code is missing? Thank you in advance and I’m beyond grateful for your patience with my questions 🙂

Advertisement

Answer

Remove ‘=’ in condition “$i<=count($name)”. Write “$i < count($name)”.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement