Skip to content

Implementing in PHP

Dr. Simon Antony Roberts edited this page Feb 24, 2018 · 2 revisions

Raw Output Implementation

The following code implements the raw.api call for strata importing the implemented array:

$strata = eval("?>".file_get_contents("http://strata.localhost/v2/strata/raw.api")."<?php");

The following code implements the raw.api call for fallout importing the implemented array:

$fallout = eval("?>".file_get_contents("http://strata.localhost/v2/fallout/raw.api")."<?php");

JSON Output Implementation

The following code implements the json.api call for strata importing the implemented array:

$strata = json_decode(file_get_contents("http://strata.localhost/v2/strata/json.api"), true);

The following code implements the json.api call for fallout importing the implemented array:

$fallout = json_decode(file_get_contents("http://strata.localhost/v2/fallout/json.api"), true);

SERIAL Output Implementation

The following code implements the serial.api call for strata importing the implemented array:

$strata = unserialize(file_get_contents("http://strata.localhost/v2/strata/serial.api"));

The following code implements the serial.api call for fallout importing the implemented array:

$fallout = unserialize(file_get_contents("http://strata.localhost/v2/fallout/serial.api"));

XML Output Implementation

The following code implements the xml.api call for strata importing the implemented array:

$strata = new SimpleXMLElement(file_get_contents("http://strata.localhost/v2/strata/xml.api"));

The following code implements the xml.api call for fallout importing the implemented array:

$fallout = new SimpleXMLElement(file_get_contents("http://strata.localhost/v2/fallout/xml.api"));