note 58189 deleted from language.types.array by betz
| From: | betz@php.net | Date: | Thu, 27 Oct 2005 08:07:14 +0000 |
| Subject: | note 58189 deleted from language.types.array by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-97661@lists.php.net to get a copy of this message | ||
Note Submitter: thomasfauskanger at gmail dot com
----
I kept getting this error message:
«Cannot use a scalar value as an array in /var/www/html/page.php»
My problem was that I had an array
$foo[$x] = "something";
and further down the script I had forgotten the "[$x].", meaning I just wrote
$foo = "something else";
(Where it of course should be «$foo[$x] = "something else";»)
The loop was hundreds of lines long, so I spent hours trying to figure out what was wrong. So if you
get the same error, check if you have remembered the keys at all the arrays... :)
Hope this may help just one person...