Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for ($i = 1; $i <=8; $i++) {
- $wD = $item->windDirection['name'];
- $ruwD = function wd();
- }
- function wd(){
- switch ($wD) {
- case 'East':$wD='В';break;
- case 'East-southeast':$wD='ВЮВ';break;
- case 'East-northeast':$wD='ВСВ';break;
- case 'SouthEast':$wD='ЮВ';break;
- case 'South-southeast':$wD='ЮЮВ';break;
- case 'Southwest':$wD='ЮЗ';break;
- case 'South':$wD='Ю';break;
- case 'South-southwest':$wD='ЮЮЗ';break;
- case 'West-southwest':$wD='ЗЮЗ';break;
- case 'West-northwest':$wD='ЗСЗ';break;
- case 'West':$wD='З';break;
- case 'Northwest':$wD='СЗ';break;
- case 'North':$wD='С';break;
- case 'NorthEast':$wD='СВ'; break;
- case 'North-northwest':$wD='ССЗ';break;
- case 'North-northeast':$wD='ССВ';break;
- }
- return $wD;
- };
- for ($i = 1; $i <= 16; $i++) {
- $symbol = test($item->symbol['name']);
- };
- function test ($test){
- $world_sides=array(
- 'слегка облачно' => '1',
- 'облачно' => '2',
- 'легкий дождь' => '3',
- 'небольшой снегопад' => '4',
- 'снегопад' => '5'
- );
- if (array_key_exists($test, $world_sides)){
- return $world_sides[$test];
- }
- return $test;
- }
- for ($i = 1; $i <=8; $i++) {
- $wD = $item->windDirection['name'];
- $ruwD = function wd($wD);
- }
- function wd($wD){
- switch ($wD) {
- case 'East':$wD='В';break;
- case 'East-southeast':$wD='ВЮВ';break;
- case 'East-northeast':$wD='ВСВ';break;
- case 'SouthEast':$wD='ЮВ';break;
- case 'South-southeast':$wD='ЮЮВ';break;
- case 'Southwest':$wD='ЮЗ';break;
- case 'South':$wD='Ю';break;
- case 'South-southwest':$wD='ЮЮЗ';break;
- case 'West-southwest':$wD='ЗЮЗ';break;
- case 'West-northwest':$wD='ЗСЗ';break;
- case 'West':$wD='З';break;
- case 'Northwest':$wD='СЗ';break;
- case 'North':$wD='С';break;
- case 'NorthEast':$wD='СВ'; break;
- case 'North-northwest':$wD='ССЗ';break;
- case 'North-northeast':$wD='ССВ';break;
- }
- return $wD;
- };
- for ($i = 1; $i <=8; $i++) {
- $ruwD = function wd($item->windDirection['name']);
- }
- function wd($wD)
- {
- $world_sides=array(
- 'East' => 'В',
- 'East-southeast' => 'ВЮВ',
- //остальные стороны света
- );
- if (array_key_exists($wD, $world_sides)){
- return $world_sides[$wD];
- }
- return false;
- }
Add Comment
Please, Sign In to add comment