- var_dump: documentation ( source)
- json_encode: documentation ( source)
<?php
$response = array();
$response['block_names'] = array("getdata");
$response['type'] = "show_block";
$response['title'] = "go";
$response['set_attributes'] = new \stdClass();
$response['set_attributes']->apikey = '12332141234123412341234';
var_dump(json_encode($response));