<?php
$ch = curl_init();
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_URL,'https://jsonplaceholder.typicode.com/posts');
$result = curl_exec($ch);
curl_close($ch);
$obj = json_decode($result);
echo '<pre>';
//var_dump($obj);

    for ($i=0;$i<count($obj);$i++){
        foreach ($obj[$i] as $key=>$value){
            if ($key == 'title' || $key == 'body' )
           echo '<strong>'.$key.':</strong> '.$value.'<br>';            
        }
    }
echo '</pre>';

?>

