我拥有带加密数据(名称和姓氏)的数据库。在我的代码中,我检索数据以解密名称和姓氏。如何在数组中搜索
for ($i=0;$i<$pocet;$i++)
{
$row= mysqli_fetch_array($vysledek);
$name = $c_hash->decrypt($row['name']);
$surname = $c_hash->decrypt($row['surname']);
$a_name['id']=$name;
//echo $a_name['id'].' ';
$a_surname['id']=$surname;
//echo $a_surname['id'];
//echo '<br />';
}
enter code here
但是我该如何在这个数组中搜索?例如用户想要找到名称=“John”。 请问,可以帮我或给我一个建议?
感谢M.
http://php.net/manual/en/control-structures.foreach.php – aynber
如果你想在数据库中搜索 - 只需加密并搜索。 – eocron