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

Home » Imported messages » comp.lang.php » in_array performance in unsorted vs sorted array
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: in_array performance in unsorted vs sorted array [message #178212 is a reply to message #178211] Wed, 23 May 2012 15:01 Go to previous messageGo to previous message
William Gill is currently offline  William Gill
Messages: 31
Registered: March 2011
Karma:
Member
On 5/23/2012 10:57 AM, William Gill wrote:
> On 5/23/2012 8:16 AM, Jerry Stuckle wrote:
>>
>> Arrays in PHP are associative; their keys are handled as hash values. So
>> I suspect it makes no difference on whether the array is sorted or not.
>>
> OK, That seems to be in sync with what I'm (not) finding in Google.
>
>> Also, what's wrong with foreach() write()? That's how you get arrays
>> back into a file. Ensure you lock the file so that you don't have two
>> scripts running against it at the same time.
>>
> Nothing. I just wanted to be sure I wasn't unaware of something better,
> like a function inverse to file(). Probably looking at less then 100k
> records at any time so I guess performance won't be a problem.
>
>> But it sounds like you should be using a database. That would solve a
>> lot of your problems.
>>
> Yes it does, and that's where this is heading. Right now it is just
> summarizing some information, but eventually this will become a
> pre-processor for a db.

Pulled the trigger too soon. forgot to say Thanks.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Windows binaries 64bit for PHP
Next Topic: On the usage of "@" (error control operator)
Goto Forum:
  

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

Current Time: Fri Nov 22 03:48:33 GMT 2024

Total time taken to generate the page: 0.04556 seconds