Re: Php Weather Question
Brought to you by:
iridium
From: Martin G. <gim...@gi...> - 2004-03-16 16:42:27
|
"Fabian Louis" <fa...@fa...> writes: Hi > I=92m very sorry that I have to bother you, but I have a question > about your Script, phpweather and I dont know where to ask . The PhpWeather mailinglist found here is the best place, for then your question reaches as many people as possible: http://lists.sourceforge.net/mailman/listinfo/phpweather-devel I've CC'ed this replay to the list --- maybe someone else have had the same problems... =20=20 > It works well, but I want that the degrees and the percent symbol ( > =B0 and % ) are replaced with the words ( =93Grad=94 and > =93Prozent=94). How can I do that? > I tried this : >=20=20 > $toReplace=3D Array("=B0","%"); > $value=3D Array("Grad", "Prozent"); > $output =3D str_replace($toReplace, $value, $output); >=20=20 > But this doenst work. Why doesn't it work? Your idea should work, except that the degree symbol (=B0) is coded as the corresponding HTML entity: ° in the output from most languages, except in the wind direction in the German output, which I guess is what you're interested in. The following seems to works with German: str_replace(array('°C', '°F', '=BA', '%'), array('Grad C', 'Grad F', ' Grad', ' Procent'), $text->print_pretty()) but a more robust solution would be to edit the pw_text_de.php file directly together with the pw_text.php file. Search for '=BA' and '°' and I'm sure you'll be able to figure things out. --=20 Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather: Shows the current weather on your webpage and PHP Shell: A telnet-connection (almost :-) in a PHP page. |