JSON数据的一部分被解释为一个对象,一个类似的部分被解释为一个数组:为什么?

I have a php script that outputs text/json with the following output:

{"labels":{"ftemp":"Full time employment only","ptemp":"Part time employment only","study":"Further study only","workstudy":"Work and Study","noavail":"Not available for work","noemp":"Unemployed","other":"Other","refusal":"Information Refused"},"employjobs":{"Cambridge Beds Co Ltd.":"Accounts Assistant","Chinese Company":"Accountant"}}

Formatted more nicely it looks like this:

{
    "labels":
    {
        "ftemp":"Full time employment only",
        "ptemp":"Part time employment only",
        "study":"Further study only",
        "workstudy":"Work and Study",
        "noavail":"Not available for work",
        "noemp":"Unemployed",
        "other":"Other",
        "refusal":"Information Refused"
    },
    "employjobs":
    {
        "Cambridge Beds Co Ltd.":"Accounts Assistant",
        "Chinese Company":"Accountant"
    }
}

Now, to me both 'labels' and 'employjobs' look like they're both json objects with key-value pairs. However, when I make a JQuery getJSON call to the script, in the data object that is returned 'labels' is an object but 'employjobs' is an empty array.

What am I missing? The format of both bits of the json string look the same so why is one being interpreted as an object and the other as an empty array?

Any help very gratefully received, Thank you in advance.

UPDATE: here is the output of print_r for the data in the PHP script just before it goes through the json_encode function:

Array
(
    [labels] => Array
        (
            [ftemp] => Full time employment only
            [ptemp] => Part time employment only
            [study] => Further study only
            [workstudy] => Work and Study
            [noavail] => Not available for work
            [noemp] => Unemployed
            [other] => Other
            [refusal] => Information Refused
        )

    [employjobs] => Array
        (
            [Cambridge Beds Co Ltd.] => Accounts Assistant
            [Chinese Company] => Accountant
        )

)

As you can see, both 'labels' and 'employjobs' are key-value pair arrays and this is reflected in the JSON string output by the PHP script.

employjobs is probably empty under certain circumstances. If it should never be empty, you need to look into that. If it's valid for it to be empty, php will omit empty array syntax for JSON by default. If this is undesirable (i.e. you want an empty object) you can use the JSON_FORCE_OBJECT option for json_encode:

echo json_encode($data, JSON_FORCE_OBJECT);

This will be omitted as

'{"labels": "object with various values", "employjobs": {}}'