Let's say I'm using Ajax to receive a JSON object from a PHP script. From the examples I've seen, people invariably use an array and json_encode() it, then pass it back to the page:
// Inside the PHP script
$arr = ['firstName'=>'John', 'lastName'=>'Doe'];
So is the PHP array the only vehicle I can use to pass JSON data from the server?