The php array prompts Notice: Undefinedoffset solution. When using arrays, we often encounter an array that does not exist, resulting in the Notice: Undefinedoffset error in the case of Jane array [100, next, I will introduce how to solve this problem. when using arrays, we often encounter the error Notice: Undefined offset when using arrays that do not exist, next I will introduce how to solve this problem.
Example:
| The code is as follows: |
|
$ Array [1] = 'www. bKjia. c0m '; Echo $ array [0]; |
The input result is
Notice: Undefined offset: 1 in D: wwwrootwraskseo404.php on line 5. let's take a look at the solution.
It's easy to solve this problem, as shown in figure
| The code is as follows: |
|
Echo isset ($ array [0])? $ Array [0]: 'Array undefined '; |
In this way, we can solve this problem very well.
The Undefined offset error. next I will introduce how to solve this problem...