Guest User

Untitled

a guest
Oct 21st, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. for ($i = 1; $i <=8; $i++) {
  2. $wD = $item->windDirection['name'];
  3. $ruwD = function wd();
  4. }
  5. function wd(){
  6. switch ($wD) {
  7. case 'East':$wD='В';break;
  8. case 'East-southeast':$wD='ВЮВ';break;
  9. case 'East-northeast':$wD='ВСВ';break;
  10. case 'SouthEast':$wD='ЮВ';break;
  11. case 'South-southeast':$wD='ЮЮВ';break;
  12. case 'Southwest':$wD='ЮЗ';break;
  13. case 'South':$wD='Ю';break;
  14. case 'South-southwest':$wD='ЮЮЗ';break;
  15. case 'West-southwest':$wD='ЗЮЗ';break;
  16. case 'West-northwest':$wD='ЗСЗ';break;
  17. case 'West':$wD='З';break;
  18. case 'Northwest':$wD='СЗ';break;
  19. case 'North':$wD='С';break;
  20. case 'NorthEast':$wD='СВ'; break;
  21. case 'North-northwest':$wD='ССЗ';break;
  22. case 'North-northeast':$wD='ССВ';break;
  23. }
  24. return $wD;
  25. };
  26.  
  27. for ($i = 1; $i <= 16; $i++) {
  28. $symbol = test($item->symbol['name']);
  29. };
  30. function test ($test){
  31. $world_sides=array(
  32. 'слегка облачно' => '1',
  33. 'облачно' => '2',
  34. 'легкий дождь' => '3',
  35. 'небольшой снегопад' => '4',
  36. 'снегопад' => '5'
  37. );
  38. if (array_key_exists($test, $world_sides)){
  39. return $world_sides[$test];
  40. }
  41. return $test;
  42. }
  43.  
  44. for ($i = 1; $i <=8; $i++) {
  45. $wD = $item->windDirection['name'];
  46. $ruwD = function wd($wD);
  47. }
  48. function wd($wD){
  49. switch ($wD) {
  50. case 'East':$wD='В';break;
  51. case 'East-southeast':$wD='ВЮВ';break;
  52. case 'East-northeast':$wD='ВСВ';break;
  53. case 'SouthEast':$wD='ЮВ';break;
  54. case 'South-southeast':$wD='ЮЮВ';break;
  55. case 'Southwest':$wD='ЮЗ';break;
  56. case 'South':$wD='Ю';break;
  57. case 'South-southwest':$wD='ЮЮЗ';break;
  58. case 'West-southwest':$wD='ЗЮЗ';break;
  59. case 'West-northwest':$wD='ЗСЗ';break;
  60. case 'West':$wD='З';break;
  61. case 'Northwest':$wD='СЗ';break;
  62. case 'North':$wD='С';break;
  63. case 'NorthEast':$wD='СВ'; break;
  64. case 'North-northwest':$wD='ССЗ';break;
  65. case 'North-northeast':$wD='ССВ';break;
  66. }
  67.  
  68. return $wD;
  69. };
  70.  
  71. for ($i = 1; $i <=8; $i++) {
  72. $ruwD = function wd($item->windDirection['name']);
  73. }
  74.  
  75. function wd($wD)
  76. {
  77. $world_sides=array(
  78. 'East' => 'В',
  79. 'East-southeast' => 'ВЮВ',
  80. //остальные стороны света
  81. );
  82.  
  83. if (array_key_exists($wD, $world_sides)){
  84. return $world_sides[$wD];
  85. }
  86.  
  87. return false;
  88. }
Add Comment
Please, Sign In to add comment