Im return an array from a function and I want to grabe the elements in the array and store them as varibles.
When I do a:
$array = fetchArray();
var_dump ($array);
I get this:
array(size = 1)
0 =>
array(size = 1)
0 =>
array(size = 7)
'customerid' => string '31' (length = 2)
'username' => string 'test' (length = 4)
'active' => string '1' (length = 1)
'CustomerName' => string 'Tobias Axbard' (length = 13)
'email' => string '[email protected]' (length = 25)
'phonenumber' => string '0738032207' (length = 10)
'isstaff' => string '0' (length = 1)
So than I would like to do something like this:
$username = $array["username"];
echo $username;
But insted of the string "test" from the array I get an error:
Notice: Undefined index: username
Any ides?
PHParray functionextract. I answered a question here which might help you.