A bit late, but to anyone who is wondering why they are getting the "Warning: Cannot use a scalar value as an array" message;
the reason is because somewhere you have first declared your variable with a normal integer or string and then later you are trying to turn it into an array.
hope that helps