NYCPHP Meetup

NYPHP.org

[nycphp-talk] Loading array from file

csnyder chsnyder at gmail.com
Wed Apr 4 21:21:08 EDT 2007


On 4/4/07, Graham Hagger <g.hagger at gmail.com> wrote:

> For their internationalization they had used separate include files for
> each language, with the correct one being included at runtime based on
> the users language.
>
> Each of the language files basically just built the same associative
> array but with the correct translations for that language.  The required
> language file does get read with every page load, but this seems to take
> no time whatsoever.

Yes, this all sounds so easy. Makes me wonder why I use gettext, in fact.

If/when you use apc or some other compiler cache, you'll never notice
the include of an array with a few hundred entries. Much better than
doing database lookups, like I've seen in some applications.

-- 
Chris Snyder
http://chxo.com/



More information about the talk mailing list