implementation of translation table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    implementation of translation table

    Hi folks,

    I'm currently rewriting some code (because of charset issues) and I need to re-implement the translation table, which is currently a global array.

    does anyone have a good idea how to do this in a proper way (i.e. without using global vars)?

    thanks
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    I think I understand your idea.
    It is a smallish set of data. not worth putting in a database table
    so at the moment it is hard coded.

    My preference in these circumstances is to use a text file
    of the same format as a .ini file.
    Then use parse_ini_file to read the data into an array.

    The added advantage of this is that non-tech personnel
    can edit the file without breaking code

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #3
      Originally posted by code green
      It is a smallish set of data. not worth putting in a database table so at the moment it is hard coded.
      actually, it's too much data to write them into DB by hand. (I also want to leave the DB as is, so other users of this guestbook are able to use this code too).

      I like the idea of the .ini file. many thanks for the input, this should get me going.

      Dormi

      Comment

      Working...