Re: Array to String

From: Date: Mon, 26 Jun 2006 03:35:54 +0000
Subject: Re: Array to String
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-238605@lists.php.net to get a copy of this message
You are probably passing some variables into POST or GET using the array notation: /mypage.php?var[]=fred&var[]=wilma $_GET['var'] will be an array inside mypage.php, You should probably check to see if it's an array then, if it is, loop through each element of the var array Chris weetat wrote:
Hi all, I have the error below in my PHP version 4.3.2: PHP Notice: Array to string conversion in /data/html/library/config.php on line 45 If i have turned "on" the magic_quotes in php.ini, it is ok . Any ideas? It cause by the code below: if (!get_magic_quotes_gpc()) {
    if (isset($_POST)) {
        foreach ($_POST as $key => $value) {
            $_POST[$key] = trim(addslashes($value));
        }
    }
    if (isset($_GET)) {
        foreach ($_GET as $key => $value) {
            $_GET[$key] = trim(addslashes($value));
        }
    }
}


« previous php.general (#238605) next »