[PHP] Undefined offset:0 Error

Source: Internet
Author: User

When using PHP recently, the page always reported this error:

Undefined offset:0

Because the Error object row is a line of use for a two-dimensional array.
When we examine the logic carefully, we find that the second dimension of the two-bit array does not have the problem of assigning values starting at 0, as follows:

Tdarray[0][0]=1;
tdarray[0][1]=2;
tdarray[1][2]=3;

It should actually be as follows (Tdarray[1][2] should be tdarray[1][0]):

Tdarray[0][0]=1;
tdarray[0][1]=2;
tdarray[1][0]=3;

It's a small problem, but the lack of clarity in logic makes it a little bit more time-consuming to investigate. Let's write it down. Above.
(actually the title forgot to change ...) Welcome to the Markdown Editor ... Ray's dead. )

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.