$a1=array(
"channelOne"=>"-45",
"channelTwo"=>"-100",
"channelThree"=>"-20"
);
$a2=array(
"channelOne"=>"-48",
"channelTwo"=>"-90",
"channelThree"=>"-22"
);
$diff = array_map(
function ($a1, $a2)
{
return abs($a1-$a2);
}, $a1,$a2
);
print_r($diff);
$ourFileName = "testFile.txt";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fclose($ourFileHandle);
我试图将结果写入文件。但我没能做到。有人可以帮我吗?
警告:fopen(testFile.txt):打开流失败:权限被拒绝