As porneL says, the whole point of arrays is that keys are unique.
If you want to reference multiple entries in an array then you need to search the array values.
$arr=array(
0=>array('date'=>time(), 'ip'=>'127.0.0.1', url='index.php'),
1=>array('date'=>time(), 'ip'=>'192.168.1.2', url='index.php'),
2=>array('date'=>time(), 'ip'=>'127.0.0.1', url='other.php'));
$matches=retrieve_keys_matching_subkey($arr, 'ip', '127.0.0.1');
foreach ($matches as $i) {
print implode(' ', $arr[$i]) . "\n";
}
function retrieve_keys_matching_subkey($arr, $subkey, $value)
{
$out=array();
foreach ($arr as $key=>$sub) {
if ($sub[$subkey]===$value) {
$out=$key;
}
}
return $out;
}
This is obviously going to be more efficient if you maintain indexes. The code for this is not trivial.
If you're working with large datasets then I'd strongly recommend using a DBMS to manage the data. If that is not practical, then use a linked list.