最近购买了带有macOS Sierra的Macbook Pro,并安装了XAMPP版本7.0.31。
开启MYSQL,ProFTPD和Apache Web Server之后,当我打开phpmyadmin时注意到了一些东西。
下面说了一个错误:
The $cfg['TempDir'] (./tmp/) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.
Run Code Online (Sandbox Code Playgroud) 我如何打开这个数组:
$details = ["Dog" => "Natahlia", "Cat" => "Ryan", "Bird" => "Natahlia"];
Run Code Online (Sandbox Code Playgroud)
到此(所需的输出):
$details = [["Natahlia"=>["Dog","Bird"], "Ryan"=>"Cat"];
Run Code Online (Sandbox Code Playgroud)
由于我的代码连接了值或覆盖了值,因此遇到了一些麻烦。
$arr = array();
foreach($details as $key => $value){
if(array_key_exists($value,$arr)){
//this part i dont know what to do since += wont do it since it's a string and .= concatenates it
$arr[$value] = $key;
} else {
$arr[$value] = $key;
}
}
return $arr;
Run Code Online (Sandbox Code Playgroud)