Page 1 of 1

[SOLVED] relational arrays, deep nesting, syntax error ?

Posted: Tue Feb 15, 2005 3:11 pm
by jcpunk
I am trying to put together the most orginized way I can think of to store a crap load of various servers connection methods, and auth stuff for a script. It is set to 700 (unix) so I am not too worried about having clear text passwords, especially since it sits in root's home on the only server worth hacking... Any way, I am attempting to create this array...

Code: Select all

$servers['win'] = array('username' => 'myusername',
                                   'password'   => '********',
                                   'connectmethod' => 'VNC',
                                   'location' => "site1,servers/$servers['win']['username']");

The entry $servers['win']['treelocation'] throws a syntax error..... ?

doah....

Posted: Tue Feb 15, 2005 3:12 pm
by jcpunk

Code: Select all

'location' => "site1,servers/$serversї'win']ї'username']");
should be:

Code: Select all

'location' => 'site1,servers/' . $serversї'win']ї'username']);
The dot operator works just fine there and all is well.......