I am new at PHP and doing some tutorial to learn.Here I got a problem which I am getting a Notice from php when i want to add a CSV file to an HTML table using php!
Notice: Undefined offset: 2 in C:\wamp\www\Test\Q2.php on line 40
Notice: Undefined offset: 1 in C:\wamp\www\Test\Q2.php on line 40
the line 40 of my code is:
Code: Select all
list($x,$y,$a) = explode(",",$linedata);
Deprecated: Function split() is deprecated in C:\wamp\www\Test\Q2.php on line 40
could you please let me know what i am doing wrong?
Code: Select all
echo "<TABLE border=3.5>";
while (!feof ($fp))
{
$linedata = fgets( $fp,200 );
list($x,$y,$a) = explode(",",$linedata);
echo "<TR><TD>$x</TD><TD>$y</TD><TD>$a</TD></TR>";
}
echo "</TABLE>";