The return statement is entirely internal to PHP, it is not visible to any other process. In the context you've used it, the argument is simply ignored. There would be no way for anything other than PHP to understand something like an array anyway, as that is a data structure unique to the PHP runtime engine.
The main "result" of a PHP script (in a web server context) is its output, which is passed via the web server to the browser at the other end of the connection. You can also influence the HTTP headers the web server will include, using the header() function.
To output data for use elsewhere, you need to come up with a string representation. The easiest is probably to use echo json_encode($value);