ILIAS  trunk Revision v11.0_alpha-1846-g895b5f47236
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Json.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 
34 class Json implements Transformation
35 {
38 
39  public function transform($from)
40  {
41  return json_encode($from, JSON_HEX_QUOT | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_THROW_ON_ERROR);
42  }
43 }
This class expects a valid UTF-8 string.
Definition: Json.php:34
transform($from)
Perform the transformation.
Definition: Json.php:39
A transformation is a function from one datatype to another.