MyBuzz.fun

true, // return web page CURLOPT_HEADER => false, // don't return headers CURLOPT_FOLLOWLOCATION => true, // follow redirects CURLOPT_MAXREDIRS => 10, // stop after 10 redirects CURLOPT_ENCODING => "", // handle compressed CURLOPT_USERAGENT => "test", // name of client CURLOPT_AUTOREFERER => true, // set referrer on redirect CURLOPT_CONNECTTIMEOUT => 120, // time-out on connect CURLOPT_TIMEOUT => 120, // time-out on response ); $url = 'https://z.today/wp-json/newsfeed/v1/latest-posts/7'; $ch = curl_init( $url ); curl_setopt_array( $ch, $options ); $content = curl_exec( $ch ); curl_close( $ch ); if($content !== false){ $myJSON = json_decode( $content, true ); $i = 0; foreach ( $myJSON as $data ) { if ( $i == 1 ) { echo '
'; } echo "
"; echo "
" . $data['post_date'] . "
"; echo "
" . $data['post_title'] . "
"; echo "
"; echo "
" . substr( $data['post_content'], 0, 250) . "...
"; echo "
"; $i ++; } } ?>