如何匹配键和值(缩写和国家/地区)并计算总百分比?
$def = array( "AF" => "Afghanistan", "AL" => "Albania", "DZ" => "Algeria", "AD" => "Andorra", ...)
$var = ["AF", "AF", "DZ"];
结果: 66%阿富汗 33%阿尔及利亚
答案 0 :(得分:0)
我们可以使用array_diff_key()比较两个数组的键和值,
<!DOCTYPE html>
<html>
<body>
<?php
$a1=array("a"=>"red","b"=>"green","c"=>"blue");
$a2=array("a"=>"red","c"=>"blue","d"=>"pink");
$result=array_diff_key($a1,$a2);
print_r($result);
?>
</body>
</html>
希望,这会有所帮助。
答案 1 :(得分:0)
volumeMounts:
- mountPath: $JFROG_PATH
name: secrets
- mountPath: /config
name: vault