如何通过在 php 中提供数组的键来提取值
How to extract the value by providing the key of an array in php
我从数据库中检索到以下结果集。我应该如何提取 employeeName 键中的值?
Array
(
[0] => Array
(
[id] => 2
[employeeName] => John
[designation] => Assistant Accountant
[rlevel] => Level 3
[comments] => LOL
[employeeCompany] => BDL
[employeeCompanyCode] =>
[uNo] => 41201
[uCompany] => BOD
[employeeNo] =>
)
)
只需拨打:
$value = $array[0]["employeeName"];
我从数据库中检索到以下结果集。我应该如何提取 employeeName 键中的值?
Array
(
[0] => Array
(
[id] => 2
[employeeName] => John
[designation] => Assistant Accountant
[rlevel] => Level 3
[comments] => LOL
[employeeCompany] => BDL
[employeeCompanyCode] =>
[uNo] => 41201
[uCompany] => BOD
[employeeNo] =>
)
)
只需拨打:
$value = $array[0]["employeeName"];