Read data from file and later on search throu that data
How could i efficiently store bunch of strings from a file and later compare all of them one by one with another string until i find a match ?
Also if first char in string matches with my char, how can a read rest of the string without the first one ? |
Re: Read data from file and later on search throu that data
You should read a bit about Tries (quim explained about them)
|
Re: Read data from file and later on search throu that data
Quote:
PHP Code:
|
Re: Read data from file and later on search throu that data
Tnx fysiks. I did read about tries, but as i as seem to understand it, it saves data in pairs by key and value, and i only need to save certain values and seach them.
|
Re: Read data from file and later on search throu that data
Quote:
Quote:
|
Re: Read data from file and later on search throu that data
How large will this list of strings be/get? How long are each of the strings, is there a max? How is this file of strings created? by the same plugin? notepad? another plugin?
|
Re: Read data from file and later on search throu that data
I write down in a file several steam id's (around 10) to log some stuff when they are on server.
|
Re: Read data from file and later on search throu that data
Since you are only storing a handful of steam-id's then I would read the file at plugin_init and cache all the steam id's in an array. If the file changes during run-time you can read directly from the file.
|
| All times are GMT -4. The time now is 07:25. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.