@Hawkee do you believe there is a way to do exactly this think with smaller code? Are there any tweeks can be made to this code? What's your opinion?\

Hawkee  -  Nov 28, 2013

Looks like your'e just doing a linear search which should be fine for your purposes. I'm sure there are more advanced methods, but this should suffice.

ProIcons  -  Nov 28, 2013

Don't get it. Please enlighten me what other advanced methods exists?

Hawkee  -  Nov 28, 2013

Well for example you could load the file into memory as a searchable hash which would allow for multiple queries with only a single scan of the file, but I don't think this would be necessary.

ProIcons  -  Dec 05, 2013

Think about an Active Listening Server with PHP, And in the other side a Web PHP Page. Now Lets say the PHP Page is our Settings Page, and the other part is our Server. Modifying the INI File through our Web Page would change our ini file. Though if we had loaded the whole ini file into our memory through our server, it wouldn't gonna read the new values. It would be with an out of date config.

I get it though, in some other apps, would be more useful to save it in an array , in order to make unlimited queries with less processing and reading time. This particular script can be modified to allow caching the data to a permanent array. When i find some free time, i will give it a try.

ProIcons  -  Sep 13, 2014

My Mistake, Misunderstood your hint.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.