> For the complete documentation index, see [llms.txt](https://php-etl.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://php-etl.gitbook.io/docs/transformers/jsondecode.md).

# JSON Decode

Decodes a JSON string.

```php
$etl->transform('json_decode', $options);
```

## Options

### Columns

Columns that will be transformed. If `empty`, the transformation is applied to all columns.

| Type  | Default value |
| ----- | ------------- |
| array | `[]`          |

```php
$options = ['columns' => ['preferences']];
```

### Associative

Indicates if objects will be converted to associative arrays.

| Type | Default value |
| ---- | ------------- |
| bool | `false`       |

```php
$options = ['assoc' => true];
```

### Depth

The maximum depth. Must be greater than zero.

| Type | Default value |
| ---- | ------------- |
| int  | 512           |

```php
$options = ['depth' => 32];
```

### Options

Bitmask of JSON decode options. Currently there are two supported options. The first is JSON\_BIGINT\_AS\_STRING that allows casting big integers to string instead of floats which is the default. The second option is JSON\_OBJECT\_AS\_ARRAY that has the same effect as setting assoc to TRUE.

| Type | Default value |
| ---- | ------------- |
| int  | 0             |

```php
$options = ['options' => JSON_FORCE_OBJECT];
```
