Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $url = "https://cryptopanic.com/news/rss/";
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- $data = curl_exec($ch);
- curl_close($ch);
- $xml = simplexml_load_string($data);
- $json = json_encode($xml);
- $array = json_decode($json,TRUE);
- //print_r($array);
- //foreach($array as $value)
- //while($i===2){
- for ($i = 0; $i <= 12; $i++) {
- //echo $array["channel"]["item"][$i]["title"]."\r\n";
- //echo $array["channel"]["item"][$i]["link"]."\r\n";
- echo "<table style=\"width: 270px;\">\n";
- echo "<tbody>\n";
- echo "<tr>\n";
- echo "<td style=\"text-align: left; width: 164px;\"><strong>".$array["channel"]["item"][$i]["title"]."</strong></td>\n";
- echo "</tr>\n";
- echo "<tr>\n";
- echo "<td style=\"width: 164px;\">".$array["channel"]["item"][$i]["link"]."</td>\n";
- echo "</tr>\n";
- echo "</tbody>\n";
- echo "</table>\n";
- }
- //echo $array["channel"]["item"][0]["title"];
- //echo $title=$value->title;
- //$btc = $json["BTC"]*$row['value'];
- //}
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement