Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $string = simplexml_load_file('http://img.ignio.com/r/export/utf/xml/weekly/cur.xml');
- $zodiac = [
- 'aries' => 'Овен',
- 'taurus' => 'Телец',
- 'gemini' => 'Близнецы',
- 'cancer' => 'Рак',
- 'leo' => 'Лев',
- 'virgo' => 'Дева',
- 'libra' => 'Весы',
- 'scorpio' => 'Скорпион',
- 'sagittarius' => 'Стрелец',
- 'capricorn' => 'Козерог',
- 'aquarius' => 'Водолей',
- 'pisces' => 'Рыбы',
- ];
- $result = '';
- foreach($string as $key => $value) {
- if (!empty($value->business) and !empty($zodiac[$key])) {
- $result .= $zodiac[$key] . "\n" . $value->business . "\n";
- }
- }
- $result .= 'По материалам сайта www.ignio.com';
- $file_path = '/Users/Uncater/Desktop/stars.txt';
- if (file_exists($file_path)) {
- file_put_contents($file_path, $result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement