/ LJCPHPCodeDoc / LJCCommonLib / LJC / CreateJSON


Parameters
$value - The object value.

Returns

The JSON text.

Syntax

PHP
public static function CreateJSON($value): string

Creates JSON from the provided value.

Example

PHP
 // Creates JSON from the provided value.
 private static function CreateJSON()
 {
   $value = (object) [
     "Name" => "John",
     "Number" => 5,
   ];
   $result = LJC::CreateJSON($value);
 
   // result:
   // {"Name":"John","Number":5}";
 }

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.