Reputation:
When I check value of an array using var_dump() function.
var_dump($data['content']);
I have result
array(1) { [0]=> array(10) { ["IDUser"]=> string(1) "1" ["Name"]=> string(5) "admin" ["Password"]=> string(32) "44ca5fa5c67e434b9e779c5febc46f06" ["Fullname"]=> string(18) "Nguyễn Tá Lợi" ["Gender"]=> string(1) "0" ["Birthday"]=> string(10) "0000-00-00" ["Address"]=> string(0) "" ["Email"]=> string(0) "" ["PhoneNumber"]=> string(0) "" ["Status"]=> string(1) "1" } }
I want get value with key ["Name"] so I use $data['content']['Name']
but it's incorrect
How to get value of "Name" in this array?
Upvotes: 2
Views: 60
Reputation: 16117
Value of Name
is available on 0 index of content
so you can not get the Name value as:
$data['content']['Name']
You need to get Name as:
$data['content'][0]['Name'] // add 0 index of content.
Upvotes: 2