<?php
$array = new stdClass();
$array->response = new stdClass();
$array->response->count = 16;
$array->response->items = [
[
"id" => "1",
"is_dir"=> "true"
],
[
"id" => "1",
"is_dir"=> "true"
],
];
var_dump(json_encode($array));
// string(89) "{"response":{"count":16,"items":[{"id":"1","is_dir":"true"},{"id":"1","is_dir":"true"}]}}"