I know a little PHP, but not enough to write my whole script. Any help or tips (on the whole or on a part) would be greatly appreciated.
I know I could do this with XML, but I don't have time to learn it before this project must be finished!
Here goes.
I have a bi-language html file. In each html tag, the french is surrounded by a <fr> tag, the german by a <de> tag. Like this:
<li><fr>french text</fr><de>german text</de></li>
So first, I need to assign the file to a filehandle (not sure how to do that!) and use ereg_replace to strip the tags off the "chosen" language, and delete everything in the "other language" tags.
I guess I need a regex which looks like:
<fr>[</fr>].*</fr> - I guess it's not really correct, but that's as far as I've got.
Then I need to set the language. In a cookie? can PHP do that? Because if I call the page saying "/file.php?lang=fr", following any hyperlink will reset $lang and I lose my language setting.
I suppose the script which holds this together needs to set the filehandle to the file which was asked for, do the replacement depending on the value of $lang, and then feed the result to the browser (how do I make it do that?).
As you can see, I think I have the basic structure worked out, but I don't know enough to deal with the details.
Thanks a lot if you can help me out - for one part or another!!
Tara
http://www.tarastar.f2s.com/