PHP Notice: Undefined offset: 1 with array when reading data

前端 未结 10 1529
遇见更好的自我
遇见更好的自我 2020-12-04 15:14

I am getting this PHP error:

PHP Notice:  Undefined offset: 1

Here is the PHP code that throws it:

$file_handle = fopen($pa         


        
10条回答
  •  情书的邮戳
    2020-12-04 15:39

    The ideal solution would be as below. You won't miss the values from 0 to n.

    $len=count($data);
    for($i=0;$i<$len;$i++)
         echo $data[$i]. "
    ";

提交回复
热议问题