PHP – Get Value from Another Key WIthin Same Object if Match

I want to fetch Member X of tierName into a variable when tierType match apiResponse (return value accodring to clientData that compared with apiResponse).

<?php
$clientData = '[{"tierType":"10","tierName":"Member A","isActive":"1"},{"tierType":"20","tierName":"Member B","isActive":"1"},{"tierType":"30","tierName":"Member C","isActive":"1"}]';
 
 $data = json_decode($clientData, true);
 $apiResponse = 10;
 
 foreach($data as $key=>$value)
 {
    if($apiResponse == $value['tierType'])
    {
        $variable =  "Member A";
        return $variable;
    }   
 }

?>

Is this possible in PHP? I tried $variable = $value['tierName']; but didn’t work.

Thank you in advance.