Today I encountered such a problem.
Notice: Undefined offset: 20 in D:/appserv/www/newcoop/auto_check_date.php On Line 36
I believe many new PHP learners may also encounter notice: Undefined offset :...
This problem often occurs in arrays,ProgramIt can run correctly, but there will always be a prompt on the screen: Notice: Undefined offset :..... on the Internet, it is generally used to suppress the display of PHP. the error_repoting parameter in the INI file is "eall & Notice", so that the screen can be displayed normally.
The problem is solved, but it is hard to figure out the offset: Next number (for example, notice: Undefined offset: 4 ....) what does it mean. also, the syntax in the sentence is clearly correct. Why is there a warning. after calmly thinking several times and trying every possibility, I finally found the answer. offset: the subsequent number is an incorrect array subscript, which is generally beyond the value range of the array. For example, an array $ A [] has 10 elements, if $ A [10] is displayed, an error occurs (Notice: Undefined offset: 10 ....), because the subscript of the array starts from 0, the subscript of this array can only be 0 ~ 9. therefore, when such problems occur, do not rush to suppress the display method (more easily add "error_reporting" at the beginning of the current file (fill in offset: the next number); Be sure to pay attention to the array subscript you are using. Think carefully and the problem will be quickly solved!