By Andrew Smith
I will have something like this on one of the pages in the website:
Each of those dropdown lists has the 190 language codes I mentioned in the previous post. It may not sound like a lot but 1900 <option> values really is a lot of HTML. It’s very easy to generate it all in PHP (one loop basically) but the result still has to be pulled over the internet, and suck up my bandwidth.
I had to think about this one for a bit, but I came up with a decent solution.
This made the HTML sent to the browser probably 90% smaller, which made me very happy.
Just because it’s funny, here’s what some the php code looks like, I’m glad noone else will be working with me on this so I won’t have to explain it :)
That’s PHP, HTML, and JS all in one, still cracks me up :)