FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » use of array_key_exists() to prevent duplicates?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: use of array_key_exists() to prevent duplicates? [message #173040 is a reply to message #173039] Fri, 18 March 2011 16:34 Go to previous messageGo to previous message
William Gill is currently offline  William Gill
Messages: 31
Registered: March 2011
Karma:
Member
On 3/18/2011 12:15 PM, Captain Paralytic wrote:
> Well actually I'm not clear from your OP what you really need. If the
> source program produces duplicates of old records as well as new ones,
> then provided that the new records come after the old ones, I would
> assume that the one you wanted to end up with was the latest one and
> so you would not want to use either array_key_exists() or isset().
To answer your question, not mentioned in the OP, but mentioned
subsequently, edits to the memo field should be maintained.
>
> If you want the first occurrence then all the benchmark tests show
> isset() being much more efficient than array_key_exists().
.... and this answers mine. It's easy enough to take an isset() approach
vise array_key_exists(), and still come up with what I need.

Thanks.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Php Modal
Next Topic: Pipe the content of a variable to a process
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 16:20:48 GMT 2024

Total time taken to generate the page: 0.04566 seconds