array() stuff

From: Date: Thu, 12 Apr 2001 02:05:47 +0000
Subject: array() stuff
Groups: php.general 
Request: Send a blank email to php-general+get-48228@lists.php.net to get a copy of this message
I'm trying to create the following array: $host_info = array( "hostname" => "localhost" "log" => "rocketbox_db.log" "username" => $username "password" => $password "database" => "rocketbox" "table" => $table ); however when I try and access the document, I get the following error: Parse error: parse error, expecting `')'' in /usr/home/kidlinux/htdocs/rocketbox/admin/index.php on line 26 line 26 is \* "log" => "rocketbox_db.log" *\ in the array code I pasted above. This isn't very far into my script, and I'm sure I havn't missed anything like a ) in my code anywhere before that array() declaration. I've gone over my code several times. According to the documentation (or my interpretation of it) that array should be correct. One other thing I'm unsure of that doesn't seem to be covered in the documentation is referring to variables in an array, like \* "username" => $username *\ where $username is a variable submitted by an html form via the post method. Should that work?? And what about referring to a function in an array such as the following: $value = array( "date" => $date = strftime('%Y-%m-%d') "title" => $info_title "dept" => $info_dept "info" => $info ); Is that valid? Can i just do \* "date" => strftime('%Y-%m-%d') *\ ?? Thanks for your help.

« previous php.general (#48228) next »