在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的汽车的索引.我该怎么做?
尝试执行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
。