Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save valiantboymaksud/c64f8772cd2e6b466b5453b34f306dea to your computer and use it in GitHub Desktop.
Save valiantboymaksud/c64f8772cd2e6b466b5453b34f306dea to your computer and use it in GitHub Desktop.
Cannot use a scalar value as an array PHP
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment