小编leo*_*old的帖子

使用array_search进行多维数组

在1维数组中使用array_search很简单

$array = array("apple", "banana", "cherry");
$searchValue = "cherry";
$key = array_search($searchValue, $array);

echo $key;
Run Code Online (Sandbox Code Playgroud)

但是多维数组怎么样?

    #RaceRecord

    [CarID] [ColorID] [Position]
[0]    1        1         3
[1]    2        1         1
[2]    3        2         4
[3]    4        2         2
[4]    5        3         5
Run Code Online (Sandbox Code Playgroud)

例如,我想得到位置为1的汽车的索引.我该怎么做?

php arrays multidimensional-array

27
推荐指数
5
解决办法
8万
查看次数

针对“focal.tar.gz.gpg”验证“focal.tar.gz”失败

尝试执行do-release-upgrade从 Ubuntu 18.04 升级到 20.04 时,出现以下错误

Checking for a new Ubuntu release
Get:1 Upgrade tool signature [1,554 B]                                                                                                 
Get:2 Upgrade tool [1,342 kB]                                                                                                          
Fetched 1,343 kB in 0s (0 B/s)                                                                                                         
authenticate 'focal.tar.gz' against 'focal.tar.gz.gpg' 
Authentication failed
Authenticating the upgrade failed. 
There may be a problem with the network or with the server.
Run Code Online (Sandbox Code Playgroud)

仅供参考:我已经试过了sudo apt-get install --reinstall ubuntu-keyring

ubuntu-18.04 ubuntu-20.04

10
推荐指数
1
解决办法
8189
查看次数