PHP: “Notice: Undefined variable”, “Notice: Undefined index”, and “Notice: Undefined offset”


I am running a PHP script, and keep getting errors like:

Notice: Undefined variable: my_variable_name in C:wampwwwmypathindex.php on line 10

Notice: Undefined index: my_index C:wampwwwmypathindex.php on line 11

Line 10 and 11 looks like this:
echo "My variable value is: " . $my_variable_name;
echo "My index value is: " . $my_array["my_index"];

What do these errors mean?

Why do they appear all of a sudden? I used to use this script for years and I’ve never had any problem.

What do I need to do to fix them?


jay 2 months 0 Answers 58 views 0

Leave an answer


Captcha Click on image to update the captcha .