Re: EZ array problem - What's wrong with my brain?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2006/11/30, Brian Dunning <brian@xxxxxxxxxxxxxxxx>:

var_dump() gives me this:

array(1) {
   ["1.2"]=>
   array(2) {
     ["code"]=>
     array(1) {
       [0]=>
       string(3) "111"
     }
     ["status"]=>
     array(1) {
       [0]=>
       string(3) "new"
     }
   }
}

I'm trying to set a variable to that "1.2". Shouldn't I be able to
get it with $var = $arr[0][0]?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


$keys = array_keys($var);
var_dump($keys[0]);

string(3) "1.2"

$values = array_values($var);
var_dump($values[0]);

array(2) {
  ["code"]=>
  array(1) {
    [0]=>
    string(3) "111"
  }
  ["status"]=>
  array(1) {
    [0]=>
    string(3) "new"
  }
}

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux