1. Go to this page and download the library: Download jenwachter/data-encoder 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/ */
jenwachter / data-encoder example snippets
$data = array(
"something" => "something",
"posts" => array(
array(
"title" => "This is the title",
"author" => array(
"firstName" => "John",
"lastName" => "Smith"
),
"url" => "http://www.somewebsite.com/path/to/article"
),
array(
"title" => "This is the title of another article",
"author" => array(
"firstName" => "Jane",
"lastName" => "Doe"
),
"url" => "http://www.somewebsite.com/path/to/this/article"
)
)
);
$xml = new \DataEncoder\XML($data);
$xml->render();
$xml = new \DataEncoder\RSS($channelElements, $itemElements, $data, $dataMap);
$xml->render();
$channelElements = array(
"title" => "The Title of my feed",
"link" => "http://www.google.com",
"description" => "The description of my feed",
"lastBuildDate" => 1361242244
);