error Notice: Undefined offset: 2

foreach($all as $elem)
{
//table with 4 cells one giant row and three small rows next to it
$lineData = explode("**", $elem);
$name=stripslashes($lineData[0]);
$email=stripslashes($lineData[1]);
$comment=stripslashes($lineData[2]);
$num = key($all)+1;
echo “


”;
echo “<td rowspan=“3”>$num” . “. &nbsp&nbsp”;
echo “”;
echo “”;
echo “”;
echo “”;
echo “”;
echo “
Name: $name
Email: $email
Comment: $comment
”;
next($all);
I got these errors:

Notice: Undefined offset: 1
Notice: Undefined offset: 2

Also the data go in one line, they don’t go in table cells

Any help would be greatly appreciated

Hi there,

Firstly, your &nbsp&nbsp should be    (notice the ;s)

Secondly, could you post the contents of $all or one of the $elem’s ? I can only assume that a problem has occured with your explode function, but to make sure I will need to see the value of the variable being called within it.

Sponsor our Newsletter | Privacy Policy | Terms of Service