问题
I have the following result set retrieved from the database. How should i extract the value in the employeeName key?
Array
(
[0] => Array
(
[id] => 2
[employeeName] => John
[designation] => Assistant Accountant
[rlevel] => Level 3
[comments] => LOL
[employeeCompany] => BDL
[employeeCompanyCode] =>
[uNo] => 41201
[uCompany] => BOD
[employeeNo] =>
)
)
回答1:
Just call:
$value = $array[0]["employeeName"];
来源:https://stackoverflow.com/questions/40926522/how-to-extract-the-value-by-providing-the-key-of-an-array-in-php