如何通过在php中提供数组的键来提取值

时间:2016-12-02 06:59:57

标签: php mysql sql-server associative-array

我从数据库中检索了以下结果集。我应该如何提取 employeeName 键中的值?

Array
(
    [0] => Array
        (
            [id] => 2
            [employeeName] => John
            [designation] => Assistant Accountant
            [rlevel] => Level 3
            [comments] => LOL
            [employeeCompany] => BDL
            [employeeCompanyCode] => 
            [uNo] => 41201
            [uCompany] => BOD
            [employeeNo] => 
        )

) 

1 个答案:

答案 0 :(得分:1)

请致电:

$value = $array[0]["employeeName"];