PHP Classes

File: news.php

Recommend this page to a friend!
  Classes of Ahmad Mustapha   PHP Download URL Content   news.php   Download  
File: news.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Download URL Content
Automate download of files from different sites
Author: By
Last change:
Date: 4 years ago
Size: 294 bytes
 

Contents

Class file image Download
<?php
use App\Utils\News;

require(
'vendor/autoload.php');

$site = $_GET['site'] ?? null;
if(
$site && $site != 'all'){
   
$newsList = News::$site()->fetch()->getAll();
}else{
   
$newsList = News::allSites()->fetch();
}

header('Content-Type: application/json');

echo
json_encode($newsList);