我有以下阵列哈希::检查方法不能在电子邮件键返回true
$array = [
'top' => [
'under' => [
'emails' =>
[
'[email protected]' => [
'key' => 'value',
],
'other' => [
'key' => 'value',
]
],
],
],
];
然后我执行以下命令
$tmp = Hash::check($array, '[email protected]');
这将返回false
如果我将电子邮件值更改为test
,然后执行以下行:
$tmp = Hash::check($array, 'top.under.emails.test');
它返回true
。所以我猜这是一个问题,因为@
角色...有没有办法解决这个问题?
汇总:
$tmp = Hash::check($array, 'top.under.emails.other');
var_dump($tmp); //true
$tmp = Hash::check($array, 'top.under.emails.[[email protected]]');
var_dump($tmp); //false
$tmp = Hash::check($array, '[email protected]');
var_dump($tmp); //false
$tmp = Hash::check($array, '[email protected]');
var_dump($tmp); //false
不要你需要即'$ TMP =哈希::检查字符串指标($数组,'{s}[email protected]');' – RiggsFolly
不,我不知道。如果我做了,那么''tmp = Hash :: check($ array,'top.under.emails.test');''不会返回'true''。 – gmponos
你试过'$ tmp = Hash :: check($ array,'[email protected]');'? – aldrin27