-2

Can some one help me with this code with a error on scalar value as an array?

$getal = $_POST['getal'];

For($teller=1; $teller<=11; $teller=$teller+1)
{
    $uitkomst[$teller]=$teller*$getal;
}
Shikiryu
  • 10,180
  • 8
  • 49
  • 75

1 Answers1

1
$getal = $_POST['getal'];
$uitkomst = array();
For($teller=1; $teller<=11; $teller=$teller+1)
{
  $uitkomst[$teller]=$teller*$getal;
}
Dmitry Seleznev
  • 955
  • 7
  • 7
  • Still curious about your error, since I could run your code (assuming $_POST['getal'] = 5) without error. PHP will deduce from this code that $uitkomst should be an array, although your code doesnt adhere to strict coding standards. – qrazi Nov 14 '13 at 08:52
  • Maybe because I allready got a other $_post $getal code in my script?"; } $getal = $_POST['getal']; $uitkomst = array(); For($teller=1; $teller<=11; $teller=$teller+1) { $uitkomst[$teller]=$teller*$getal; } – user2991218 Nov 14 '13 at 09:43