Re: Fatal error: [] operator not supported for strings
| From: | Zamolxe -=t_D=- | Date: | Fri, 12 Sep 2003 03:26:14 +0000 |
| Subject: | Re: Fatal error: [] operator not supported for strings | ||
| References: | 1 | Groups: | php.doc.ro |
| Request: | Send a blank email to doc-ro+get-71@lists.php.net to get a copy of this message | ||
Salut Daniel,
probabil ca $_SESSION["id_produs"] este un string.
fa urmatoarea verificare:
-------------------------
if( !is_array($_SESSION["id_produs"]) ) { unset( $_SESSION["id_produs"] ); }
then do: $_SESSION["id_produs"][]=$_POST["id_produs"];
-------------------------
Ghita S.
www.fastweb.ro
"Daniel" <naspa@profimedia.ro> wrote in message
news:20030819095706.55664.qmail@pb1.pair.com...
> Salut!
>
> Cum rezolv eroarea de mai jos???
>
>
> Fatal error: [] operator not supported for strings
> in /var/www/html/p.../magazin/cos.php on line 13
>
> linia 13 este:
>
> $_SESSION["id_produs"][]=$_POST["id_produs"];
>
> Eroarea nu apare cand rulez pe localhost, apare numai cand rulez pe Linux,
> unde am PHP 4.2.2.
>
> Multumesc
>
>