PHP code example of jvleeuwen / cspreporter

1. Go to this page and download the library: Download jvleeuwen/cspreporter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jvleeuwen / cspreporter example snippets


// Return an array of current open/scheduled issues and maintenaince windows.
$array = cspreporter::uri('http://cspreporter.nl/rss/actueel/');

// Using the configuration file.
$array = cspreporter::uri({{config('cspreporter.uri').config('cspreporter.actueel)}});

$array = [
    'id'    		=> (integer) $item->attributes()->id,
    'title' 		=> (string) $item->title,
    'description'	=> (string) $item->description,
    'pubDate'		=> (string) $item->pubDate,
    'startDate'		=> (string) $item->startDate,
    'endDate'		=> (string) $item->endDate,
    'category'		=> (string) $item->category,
    'link'			=> (string) $item->link,
];

// Uri:
$array = cspreporter::uri('<cspreporter uri>'); // grabs the uri and returns the xml as an array;

// File:
$file = cspreporter::file('<localFile>'); // parses the file and returns the xml as an array;

// Test:
$test = cspreporter::test(); // Temporary test function, will be removed later on.

// ParseRss:
$parse = cspreporter::ParseRss('simplexml_load_string('filecontents')'); // implements the simplexml_load_string, parses the xml and returns an array;