Quote:
Originally Posted by KGodel
With JSON you can get the contents on other sites. This is how many Streaming service APIs work. It's simply an ordered list. They keep it updated, whereas if I were to create one it'd be edited every time. I considered switching the keys and such but meh, I'm not sure how much it will make a difference.
I did switch to array_search though. 
|
I think you're right, it's a relatively small array so it won't make a lot of difference. And that json thing is cool, I hadn't really seen that before.
Not to criticize the other guys who are being helpful, but I didn't want to rewrite all your code for you because you didn't ask. But one thing I think I would do is change the function so it only gets the array once and saves it in a static or a global variable. That way at least you aren't getting it from a remote server once for each post.
Edit : BTW, there's also a function that swaps keys and values, but I can't remember what that one's called either.