PHP search query fields

I have this search query which works fine, but I am unable to translate this into a PHP $params associative array.

POST /index/type/_search
{
   "fields": [
       "url"
       ],
   "query": {
      "query_string": {
         "default_field": "content.content",
         "query": "german"
      }
   },
   "highlight": {
      "fields": {
         "content.content": {}
      }
   }
}

What I have so far of the PHP associative array:

$params = [
			    'index' => $index_name,
			    'type' => 'type_name',
			    'body' => [
			    	'fields' => 'url'      /* error */ 
			        'query' => [
			            'query_string' => [
			            	'default_field' => 'content.content',
			                'query' => '$term'
			            ]
			        ],
			        'highlight' => [
			        	'fields' => ['content.content'=> []]   /*   error  */
			        ]
			    ]
			];

You've even marked the area where the error is with 'error'.

'fields' => [ 'url' ]

not

'fields' => 'url'

'fields' is plural, which hints at an array.

You could also copy paste the JSON into php and use json_decode() to get a PHP array.

Don't use 'query' => '$term'. Just use 'query' => $term.