Advertisement
Ostap34JS

Untitled

Feb 25th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1.         <?php
  2.         $domain = "prometheusmooc";
  3.         $url = file_get_contents("https://api.vk.com/method/wall.getById?posts=93388_21539,93388_20904, -1_340364");
  4.         $data = json_decode($url,true);
  5.         if($data['error']['error_code']){echo "Ошибка <b>".$data['error']['error_code']."</b>";}
  6.         else{
  7.             //echo '<pre>';
  8.             //print_r($data);
  9.             for($i=1;$i<$data['response'][$i];$i++){
  10.                 echo"
  11.                <div class='wr'>
  12.                <div class='num'>".$i."</div>
  13.                <p>".$data['response'][$i]['text']."</p>
  14.                <a href='https://vk.com/".$domain."?w=wall".$data['response'][$i]['from_id']."_".$data['response'][$i]['id']."' target='_blanc'>Смотреть на стене</a>
  15.                </div>
  16.                ";
  17.             }
  18.         }
  19.         ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement