Q:

How to echo an array in PHP

How can I in an API echo results in a new array?
example: 
 echo implode('[]',$resultArray);

result: 

$resultArray

requested result: 

[$resultArray]

A:

Since you're implementing an API the best pracrice will be to output your results in a format that's readable and understandable by multiple programming languages. JSON is the way to go. Read about it here and here
To echo an array, or anything not just an array, in PHP in a JSON format use:
echo json_encode($data);
where $data holds the output

