Welcome Guest, Not a member yet? Register   Sign In
New to php Array question, probably VERY simple...
#2

[eluser]kgill[/eluser]
The reason you're getting:
Code:
$opcoesC[0] = ‘aaaaaaaaa’ => ‘aaaaaaaaaaa’
is this part here:
Code:
$opcoesC[] = array($cli...
when you use the empty brackets like that it automatically increments an integer based index. If you want to use an associative array then you have to specify the index like so:
Code:
$opcoesC[$cliente->id] = $cliente->id.' - '.$cliente->stNome;


Messages In This Thread
New to php Array question, probably VERY simple... - by El Forum - 06-25-2009, 08:09 AM
New to php Array question, probably VERY simple... - by El Forum - 06-25-2009, 08:39 AM
New to php Array question, probably VERY simple... - by El Forum - 06-25-2009, 09:24 AM
New to php Array question, probably VERY simple... - by El Forum - 06-25-2009, 10:08 AM
New to php Array question, probably VERY simple... - by El Forum - 07-29-2009, 10:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB