$document = new Document();
$document->title = $request['title'];
$document->description = $request['description'];
When i try to output the above code using echo $document; i get this result:
{"title":"asdfasdf","description":"asdfasdfsadf"}
What i want is to create my own array of data and output the same format. This is the code i am trying to experiment but it does not work:
$data = array(
"title" => "hello",
"description" => "test test test"
);
echo $data;
Any Help would be appreciated. Thanks.