Simple langauge script?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
DanX
Forum Newbie
Posts: 1
Joined: Fri Nov 15, 2002 4:19 pm

Simple langauge script?

Post by DanX »

Does anyone know a good method to setup a decent language management script? Before I was using something like

Code: Select all

<?php
$txt1 = 'you';
$txt2 = 'me';
?>

but if I wanted to add something before me, it's a pain to do, if I'm using a number system.. so does anyone have a better idea?

Thanks.
MeOnTheW3
Forum Commoner
Posts: 48
Joined: Wed Nov 13, 2002 3:28 pm
Location: Calgary, AB

Post by MeOnTheW3 »

Use an array?

$txt['me'] = 'e';
$txt['you'] = 'f';
$txt['us'] = 'a';


Really don't know what you are tring to do, though. But if you are triing to manage first and third person respective to n parties, try a multi dimensional array:

$lang['me']['first'][1] = 'I';
$lang['me']['first'][2] = 'me';
$lang['me']['first'][3] = 'mine';
$lang['me']['first'][4] = 'ours';
$lang['me']['third'][1] = '$MyName';
$lang['me']['third'][4] = 'theirs';
$lang['you']['first'][1] = 'you';
$lang['you']['first'][3] = 'yours';
$lang['you']['third'][1] = '$YourName';


make any sense, post more of the challenge more better help with a solution.
Post Reply