D
D
Dmitry Filandor2016-11-22 15:32:25
JavaScript
Dmitry Filandor, 2016-11-22 15:32:25

Api.wunderground - how to get the names of the days in Russian?

Hello!
With the help of the code I get the following weather informer:
8158235976.jpg
I would like to Russify the days of the week

<?php
$ip = $_SERVER['REMOTE_ADDR'];
$url = 'http://api.sypexgeo.net/xml/'. $ip .'';
$xml = simplexml_load_string(file_get_contents($url));
$loc_array = array($xml->ip->city->lat,$xml->ip->city->lon);
$loc_safe = array();
foreach($loc_array as $loc){
    $loc_safe[] = urlencode($loc);
}
$loc_string=implode(',', $loc_safe);
$json = file_get_contents('http://api.wunderground.com/api/****/satellite/webcams/forecast/q/' . $loc_string . '.json');
$obj = json_decode($json, true);

?>

 
 
<?

$html .= "</h2><table cellpadding=4 cellspacing=3><tr>";
 
  foreach ($obj['forecast']['simpleforecast']['forecastday'] as $arr) {
 
    $html .= "<td align='center'>" . $arr['date']['weekday'] . "<br />";
    $html .= "<img src='http://icons-pe.wxug.com/i/c/k/" . $arr['icon'] . ".gif' border=0 /><br />";
    $html .= "<font color='red'>" . $arr['high']['celsius'] . '&deg;C' . " </font>";
    $html .= "<font color='blue'>" . $arr['low']['celsius'] . '&deg;C' . "</font>";
    $html .= "</td>";
 
 
  }
  $html .= "</tr></table>";

echo $html;
?>

  
  
<script type="text/javascript">
  
window.onload=function(){

//пробовал так, не меняет, а вот в фидлере меняет
$("td:contains('Tuesday')").html("Вторник");
  
};

</script>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
tommy_13, 2016-11-22
@LifeAct

change when displaying $arr['date']['weekday']

K
krasnogorovilya, 2018-04-16
@krasnogorovilya

tell me how to pull up your pictures in this script. not standard?
and the output of the water temperature, if it is a sea city?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question