|
Posted by Ulf Kadner on 08/22/07 15:46
ZeldorBlat wrote:
> On Aug 22, 7:00 am, Ulf Kadner <dr_lo...@gmx.net> wrote:
>> You have always to check if array keys exists before accessing it!
>> There is no warranty that key 2 exists. Never...
>> Otherwise you become a error when accessing invalid keys.
>
> I disagree.
Not fine ;-)
> $a = array('foo' => 0, 'bar' => 1, 'baz' => 2);
> $tmp = array_keys($a);
>
>>From that I'll be happy to warrant that $tmp[2] exists.
The op dont says how the array was build. So its usefull to check always
if it comes with the required data. If you dont doit, your problem.
--
_,
_(_p> Ulf [Kado] Kadner
\<_)
^^
Navigation:
[Reply to this message]
|