|
171 | 171 | echo 'Precipation: '.$weather->precipitation->getDescription().' ('.$weather->precipitation.')';
|
172 | 172 | echo "<br />\n";
|
173 | 173 |
|
174 |
| -// Example 10: Show copyright notice. WARNING: This is no offical text. This hint was created regarding to http://www.http://openweathermap.org/copyright . |
| 174 | +// Example 10: Show copyright notice. WARNING: This is no official text. This hint was created by looking at http://www.http://openweathermap.org/copyright . |
175 | 175 | echo "<br /><br />\n\n\nEXAMPLE 10<hr />\n\n\n";
|
176 | 176 |
|
177 | 177 | echo $owm::COPYRIGHT;
|
178 | 178 | echo "<br />\n";
|
179 | 179 |
|
180 |
| -// Example 11: Get raw xml data. |
| 180 | +// Example 11: Retrieve weather icons. |
181 | 181 | echo "<br /><br />\n\n\nEXAMPLE 11<hr />\n\n\n";
|
| 182 | +$weather = $owm->getWeather('Berlin'); |
| 183 | +echo $weather->weather->icon; |
| 184 | +echo "<br />\n"; |
| 185 | +echo $weather->weather->getIconUrl(); |
| 186 | + |
| 187 | +// Example 12: Get raw xml data. |
| 188 | +echo "<br /><br />\n\n\nEXAMPLE 12<hr />\n\n\n"; |
182 | 189 |
|
183 | 190 | echo '<pre><code>'.htmlspecialchars($owm->getRawWeatherData('Berlin', $units, $lang, null, 'xml')).'</code></pre>';
|
184 | 191 | echo "<br />\n";
|
185 | 192 |
|
186 |
| -// Example 12: Get raw json data. |
187 |
| -echo "<br /><br />\n\n\nEXAMPLE 12<hr />\n\n\n"; |
| 193 | +// Example 13: Get raw json data. |
| 194 | +echo "<br /><br />\n\n\nEXAMPLE 13<hr />\n\n\n"; |
188 | 195 |
|
189 | 196 | echo '<code>'.htmlspecialchars($owm->getRawWeatherData('Berlin', $units, $lang, null, 'json')).'</code>';
|
190 | 197 | echo "<br />\n";
|
191 | 198 |
|
192 |
| -// Example 13: Get raw html data. |
193 |
| -echo "<br /><br />\n\n\nEXAMPLE 13<hr />\n\n\n"; |
| 199 | +// Example 14: Get raw html data. |
| 200 | +echo "<br /><br />\n\n\nEXAMPLE 14<hr />\n\n\n"; |
194 | 201 |
|
195 | 202 | echo $owm->getRawWeatherData('Berlin', $units, $lang, null, 'html');
|
196 | 203 | echo "<br />\n";
|
197 | 204 |
|
198 |
| -// Example 14: Error handling. |
199 |
| -echo "<br /><br />\n\n\nEXAMPLE 14<hr />\n\n\n"; |
| 205 | +// Example 15: Error handling. |
| 206 | +echo "<br /><br />\n\n\nEXAMPLE 15<hr />\n\n\n"; |
200 | 207 |
|
201 | 208 | // Try wrong city name.
|
202 | 209 | try {
|
|
0 commit comments