我尝试执行代码

时间:2017-08-24 14:53:10

标签: php

当我执行此代码时,我会看到一条通知:

Notice: Undefined offset:  3 [www/words/great_words.php, line 12]
Notice: Undefined offset:  6 [www/words/great_words.php, line 12]
Notice: Undefined offset:  9 [www/words/great_words.php, line 12]
Notice: Undefined offset: 12 [www/words/great_words.php, line 12]
Notice: Undefined offset: 15 [www/words/great_words.php, line 12]
Notice: Undefined offset: 18 [www/words/great_words.php, line 12]
Notice: Undefined offset: 21 [www/words/great_words.php, line 12]
Notice: Undefined offset: 24 [www/words/great_words.php, line 12]

我用过的:

<?php       
$bin = array ("1","2","3","4","5","6","7","8","9");
$tol = 9;  
$recive_wrd = $bin[0];  
for($x=1; $x < $tol; $x++)  
{  
    $recive_wrd = $recive_wrd.$bin[$x]; // <=== Line 12  
}  
$binary[$kbin] = $recive_wrd;
?>

0 个答案:

没有答案