I want to do an array of string values. But I want the key to to be defined by a variable that is an integer.
array($incremented_int => $value)
should this work, and why not?
you are allowed to do that, syntax is
$arr = array(); $x = 5; $arr[$x] = "hello"; ++$x; $arr[$x] = "there";
this way
$arr = array(); $arr[] = 'now the key is 0'; $key = 5; $arr[$key] = 'now key is 5'; $arr[++$key] = 'now key is 6'; $arr[$key++] = 'now key is 6 too, but $key is 7'; $arr[] = 'now key is 7';