Function : toJson

This converts an array to json format just like the json_encode() internal php function.

Syntax
  toJson($value)
  
  $value: value to be converted to json format
   
                  
Sample: toJson
  toJson(['name'=>'foo']); //{"name":"foo"}