我如何在php中获得密钥的特定价值

I'm getting all value of this array. I want to get a whom key value in a PHP variable how can i do that.

$fields = array('firstNameInput' => 'Name', 'lastNameInput' => 'Surname', 'countryCodeInput' => 'Country', 'phoneNumberInput' => 'Phone', 'emailInput' => 'Email', 
'companyNameInput' => 'Company', 'whom' => 'Connect to', 'subjectInput' => 'Subject',  'messageInput' => 'message'
);

foreach ($_POST as $key => $value) {
            if (isset($fields[$key])) {
                $emailText .= "$fields[$key]: $value
".$another;
            }
        }

I making a code for you, this code is helpful for you.

$fields = array(
            'firstNameInput' => 'Name', 
            'lastNameInputd' => 'Surname', 
            'countryCodeInput' => 'Country', 
            'phoneNumberInput' => 'Phone', 
            'emailInput' => 'Email',
            'companyNameInput' => 'Company', 
            'whom' => 'Connect to', 
            'subjectInput' => 'Subject',
            'messageInput' => 'message'
            );
 $fields2 = array('whom');
 $fields2=array_flip($fields2);
 $result=array_intersect_key($fields,$fields2);

  foreach($result as $value)
  {
     echo $value.'<br>';
  }

I make a new array and pass keys which you want(any key you can pass) in $fields2. now array is Array ( [0] => whom ) array_filp($fields2) is using for convert value to key . array_intersect_key($fields,$fields2) given result is

Array ( [whom] => Connect to )

finally you have a key result.