NYCPHP Meetup

NYPHP.org

[nycphp-talk] Loading array from file

Graham Hagger g.hagger at gmail.com
Wed Apr 4 11:02:15 EDT 2007


David,

I recently had to do some work with our companies meeting room booking
system, which was originally based on the open source PHP based MRBS
project that's out there somewhere.

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.

Hope this helps... it is my first post to this list :)

Graham

David Krings wrote:
> Hi!
>
> Working on my internationalization project I am now ready to load the
> contents of a string file into an array and use the strings. Now, I
> have to ideas when to do this:
> a) run this on load of every page with output
> b) run it once on the start page and store the array in the session
>
> Does anyone have any experience with doing one or the other (or both)?
> I wonder which way is the faster / more robust.
>
> My guess is that after I'm done the string file will have several
> hundred entries.
>
> Thanks in advance.
>
> David
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php




More information about the talk mailing list