By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,965 Members | 1,702 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,965 IT Pros & Developers. It's quick & easy.

Undefined offset: error

P: 2
<?php
$i=2;
$k=0;
$input="a,b,c,d";
$inputexplode=explode(",",$input);



for($k=0; $k<=$i*$i;$k++)
{
echo $inputexplode[$k];
}

?>



is there any mistake??????
thank you
May 5 '12 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 1,035
You for loop starts with 0, so you should end when $k<$i*$i, and ot when $k<=$i*$i
May 5 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.